Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string.h>
- using namespace std;
- int main()
- { char s[256],max[256];
- int n,i,lmax=0;
- ifstream in("lgmax.in");
- ofstream out("lgmax.out");
- in>>n;
- for(i=1;i<=n;i++)
- { in.getline(s,256);
- if(strlen(s)>lmax)
- { lmax=strlen(s);
- strcpy(max,s);
- }
- }
- out<<max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement