Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,modulo,x;
- cout<<"Podaj liczbe: ";
- cin>>n;
- do
- {
- modulo=n%2;
- if(modulo==0)
- n/=2;
- }
- while(modulo==0);
- do
- {
- modulo=n%3;
- if(modulo==0)
- n/=3;
- }
- while(modulo==0);
- if(n==1) cout<<"TAK";
- else cout<<"NIE";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement