Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. // Example program
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.         int k;
  10.         unsigned long long govno;
  11.         cin >> k;
  12.        
  13.         for(int i = 0; i < k; i++)
  14.         {
  15.             cin >> govno;
  16.             int jopa = 0;
  17.            
  18.             for(unsigned long long j = 0; j <= govno; j++)
  19.             {
  20.                 string ss = to_string(j);
  21.    
  22.                 jopa++;
  23.                 for(int k = 0; k < ss.size(); k++)
  24.                 {
  25.                     if(ss[k] == '1' || ss[k] == '2' || ss[k] == '3' || ss[k] == '5' || ss[k] == '8')
  26.                     {
  27.                         jopa--;
  28.                         break;
  29.                     }
  30.                 }
  31.             }
  32.            
  33.             cout << jopa << endl;
  34.         }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement