Advertisement
Josif_tepe

Untitled

Mar 4th, 2022
1,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int l, r;
  8.     cin >> l >> r;
  9.     int pomosna_l = l;
  10.     int ok = 1;
  11.     while(l > 0)
  12.     {
  13.         int cifra = l % 10;
  14.         if(cifra == 0)
  15.         {
  16.             ok = 0;
  17.             break;
  18.         }
  19.         if (pomosna_l % cifra != 0)
  20.         {
  21.             ok = 0;
  22.         }
  23.         l /= 10;
  24.    
  25.     }
  26.     if (ok == 0)
  27.     {
  28.         cout << "NE E ZIMSONOV" << endl;
  29.     }
  30.     else {cout << "ZIMSONOV" << endl;}
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement