Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int count=0;;
  8.     for (int i=10000; i<=77777; i++){
  9.         if ((i / 10000 <=7) && (i / 1000 % 10 <=7) && (i / 100 % 10 <=7) && (i / 10 % 10 <=7) && (i % 10 <=7)){
  10.             if (((i / 10000) <= (i / 1000 % 10)) && ((i / 1000 % 10)<=(i / 100 % 10 )) && ((i / 100 % 10 )<=(i / 10 % 10 )) &&((i / 10 % 10 )<=(i % 10 ))){
  11.                 count++;
  12.             }
  13.         }
  14.     }
  15.     cout<<count;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement