Advertisement
Josif_tepe

Untitled

Oct 6th, 2021
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int opagacki_red(int broj){
  7.  if(broj<10){
  8.     return 1;
  9.  }
  10.  int a=broj%10;
  11.  int b=(broj/10)%10;
  12.  
  13.  if(b>a){
  14.     return opagacki_red(broj/10);
  15.  }
  16.  else{
  17.   return 0;
  18.  }
  19. }
  20.  
  21.  
  22.  
  23. int main()
  24. {
  25.  
  26. int n;
  27. cin>>n;
  28.  
  29. for(int i=0; i<n; i++){
  30. int broj;
  31. cin>>broj;
  32. cout<<opagacki_red(broj)<<endl;
  33. }
  34.  
  35.  
  36.     return 0;
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement