Josif_tepe

Untitled

Feb 23rd, 2026
168
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. using namespace std;
  3. int main () {
  4.     int n = 1447;
  5.    
  6.     int ok = 1;
  7.     for(int i = n; i > 0; i /= 10) {
  8.         int cifra = i % 10;
  9.        
  10.        
  11.         if(cifra == 1 or cifra == 4 or cifra == 7) {
  12.             ok = 1;
  13.         }
  14.         else {
  15.             ok = 0;
  16.             break;
  17.         }
  18.     }
  19.    
  20.     if(ok == 1) {
  21.         // site cifri se 1 4 ili 7
  22.     }
  23.     else {
  24.         // ne se
  25.     }
  26.     return 0;
  27. }
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment