mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 18:28:47 +00:00
parent
490bc0cee6
commit
6814f5b0e0
21
tk.hustoj.com/1348/1348.cpp
Normal file
21
tk.hustoj.com/1348/1348.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
string s;
|
||||
getline(cin, s);
|
||||
vector<string> args, file;
|
||||
stringstream ss;
|
||||
ss << s;
|
||||
while (ss >> s) {
|
||||
args.push_back(s);
|
||||
}
|
||||
int count = 10;
|
||||
if (args.size() >= 2) count = -atoi(args[1].c_str());
|
||||
while (getline(cin, s)) file.push_back(s);
|
||||
for (int i = max((int)file.size() - count, 0); i < file.size(); i++) {
|
||||
cout << file[i] << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user