Advertisement
STANAANDREY

mount

Feb 14th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main ()
  5. {
  6.  
  7. unsigned long long n,uc,ok=0;
  8.  
  9. cin>>n;
  10. uc=n%10;
  11. n/=10;
  12.  while (n)
  13. {
  14.     if (n%10>uc)
  15.     {
  16.         uc=n%10;
  17.         n/=10;
  18.     }
  19.     else {
  20.     //uc=n%10;
  21.     ok=1;
  22.     break;
  23.     }
  24. }
  25. //cout<<uc<<n%10;
  26. if (uc==n%10)
  27. {
  28.     cout<<"NU";
  29.     return 0;
  30. }
  31. cout<<endl;
  32. n/=10;
  33. while (n)
  34. {
  35.      if (n%10<uc)
  36.      {
  37.          uc=n%10;
  38.          n/=10;
  39.      }
  40.     else
  41.     break;
  42. }
  43.  
  44.  if (!n&&ok)
  45.  cout<<"da";
  46.  else
  47.     cout<<"nu";
  48.  
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement