Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cctype>
- #include <fstream>
- using namespace std;
- ifstream fin("sortcuv.in");
- ofstream fout("sortcuv.out");
- int main()
- {
- string s[201],x;
- int n=0;
- while(fin>>x)
- s[++n]=x;
- for(int i=1;i<n;i++)
- {
- for(int j=i+1;j<=n;j++)
- if(s[i]>s[j])
- swap(s[i],s[j]);
- }
- for(int i=1;i<=n;i++)
- fout<<s[i]<<endl;
- fin.close();
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement