Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int liczba, x, y = -1;
- bool flaga = true;
- cin >> liczba;
- while(liczba > 0)
- {
- x = y;
- y = liczba % 10;
- liczba = liczba / 10;
- if(x >= y)
- {
- flaga = false;
- break; // automatyczne wyjście z pętli
- }
- }
- if(flaga)
- cout << "Cyfry sa ulozone malejaco\n";
- else
- cout << "Cyfry nie sa ulozone malejaco\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement