Bob103

dsa

Apr 5th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. //#include<climits>
  4. #include <fstream>
  5.  
  6. using namespace std;
  7. int main()
  8. {
  9. ifstream in("Input.txt");
  10. ofstream out("Output.txt");
  11. string s;
  12. int min, row, i = 1;
  13. min =INT_MAX;
  14. while (in.peek() != EOF)
  15. {
  16. getline(in,s);
  17. int count = s.size();
  18. if (count < min)
  19. {
  20. min = count;
  21. row = i;
  22. }
  23. ++i;
  24. }
  25. out << row << endl;
  26. in.close();
  27. out.close();
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment