Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstring>
- using namespace std;
- void rezolvare()
- {
- char mmax[31]="a",mmin[31]="w";
- ifstream in("cuvinte.in");
- ofstream out("cuvinte.out");
- int n,nr;
- char a[31];
- in>>n;
- in.get();
- while(in.get(a,30))
- {
- if(strncmp(a,mmax,30)>0)
- strcpy(mmax,a);
- if(strncmp(a,mmin,30)<0)
- strcpy(mmin,a);
- in.get();
- }
- out<<mmin<<endl;
- out<<mmax;
- }
- int main()
- {
- rezolvare();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement