Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- unsigned long long n,uc,ok=0;
- cin>>n;
- uc=n%10;
- n/=10;
- while (n)
- {
- if (n%10>uc)
- {
- uc=n%10;
- n/=10;
- }
- else {
- //uc=n%10;
- ok=1;
- break;
- }
- }
- //cout<<uc<<n%10;
- if (uc==n%10)
- {
- cout<<"NU";
- return 0;
- }
- cout<<endl;
- n/=10;
- while (n)
- {
- if (n%10<uc)
- {
- uc=n%10;
- n/=10;
- }
- else
- break;
- }
- if (!n&&ok)
- cout<<"da";
- else
- cout<<"nu";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement