velimir

broevi

Apr 5th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int i=0, l, r, x, x1, x2, x3, x4;
  8.     cin >> l >> r;
  9.     for( ;l<=r; l++)
  10.     {
  11.         x = l;
  12.         x4=x%10;
  13.         x/=10;
  14.         x3=x%10;
  15.         x/=10;
  16.         x2=x%10;
  17.         x/=10;
  18.         x1=x%10;
  19.         x/=10;
  20.         if(x1<x2 and x2<x3 and x3<x4)i++;
  21.     }
  22.     cout << i;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment