Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream fin("lgmax.in");
- ofstream fout("lgmax.out");
- char v[300],maxim[300] = {'\0'};
- int i,j = 0,n;
- fin>>n;
- fin.get();
- for(i=1;i<=n;i++){
- fin.get(v,300);
- fin.get();
- if(j < strlen(v)){
- j = strlen(v);
- strcpy(maxim,v);
- }
- }
- fout<<maxim;
- fin.close();
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement