Advertisement
FloudMe77

Untitled

Mar 26th, 2019
89
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. int main()
  5. {
  6.     int n,modulo,x;
  7.     cout<<"Podaj liczbe: ";
  8.     cin>>n;
  9.     do
  10.     {
  11.       modulo=n%2;
  12.       if(modulo==0)
  13.         n/=2;
  14.     }
  15.     while(modulo==0);
  16.     do
  17.     {
  18.       modulo=n%3;
  19.       if(modulo==0)
  20.         n/=3;
  21.     }
  22.     while(modulo==0);
  23.     if(n==1) cout<<"TAK";
  24.     else cout<<"NIE";
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement