Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,cf,poz=-1,copcf=-1;
- bool ok=true;
- cin>>n;
- while (n!=0)
- {
- cf=n%10;
- n=n/10;
- poz++;
- if (poz%2==1)
- {
- if (cf<copcf)
- {
- ok=false;
- break;
- }
- copcf=cf;
- }
- }
- if (ok==true)
- cout<<"DA";
- else
- cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement