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(){
- ifstream f("cuvant.in");
- char cuv[1000],cuvMax[1000];
- int n,i;
- f>>n>>cuv; strcpy(cuvMax,cuv);
- for(i=1;i<n;i++){
- f>>cuv;
- if(strcmp(cuv,cuvMax)==1)
- strcpy(cuvMax,cuv);
- }
- ofstream o("cuvant.out");
- o<<cuv;
- f.close();
- o.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment