Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6. int main()
  7. { char s[256],max[256];
  8. int n,i,lmax=0;
  9. ifstream in("lgmax.in");
  10. ofstream out("lgmax.out");
  11. in>>n;
  12. for(i=1;i<=n;i++)
  13. { in.getline(s,256);
  14. if(strlen(s)>lmax)
  15. { lmax=strlen(s);
  16. strcpy(max,s);
  17. }
  18. }
  19. out<<max;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement