Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- bool rosnie(string slowo);
- int main()
- {
- ifstream dane("NAPIS.TXT");
- string slowo;
- // cout << rosnie("ABB") << endl;
- while(!dane.eof())
- {
- dane >> slowo;
- if(rosnie(slowo))
- cout << slowo << endl;
- }
- return 0;
- }
- bool rosnie(string slowo)
- {
- // bool wynik=true;
- for(int i=1; i<slowo.size(); i++)
- {
- if(slowo[i]<=slowo[i-1])
- return false;
- }
- return true;
- }
Add Comment
Please, Sign In to add comment