fork(1) download
  1. #include <string>
  2. #include <sstream>
  3. #include <fstream>
  4. #include <iterator>
  5. #include <vector>
  6. #include <algorithm>
  7. #include <iostream>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13. std::string line;
  14. while(std::getline(cin, line))
  15. {
  16. std::stringstream str(line);
  17. std::istream_iterator<int> inf(str), eof;
  18. std::vector<int> vec(inf, eof);
  19. std::cout << *std::max_element(vec.begin(), vec.end()) << std::endl;
  20. }
  21. }
Success #stdin #stdout 0s 3468KB
stdin
1 13 330 323 18 1 40 410 413 45 1 28 381 347 16 1 16 230 261 27
2 6 208 218 8 2 24 253 277 21 2 13 223 244 14 2 10 177 185 6
3 0 12 1 1 3 20 417 416 18 3 23 322 320 23 3 5 21 23 4
4 1 7 18 2 4 11 149 138 11 4 11 120 116 10 4 2 27 24 3 
stdout
413
277
417
149