Skip to content

Commit

Permalink
Update willitst.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
divyalakhwani31 authored Oct 28, 2019
1 parent c0ef40f commit 774e2d9
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions c++/willitst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ using namespace std;
int main() {
long long int n;
cin>>n;
if(n==1)

if(n == 1)
cout<<"TAK";

else
while(n%2==0&&n>0)
while(n%2 == 0 && n > 0)
{
n/=2;
if(n==1)
{cout<<"TAK";
break;}
}if(n>1)cout<<"NIE";
n /= 2;
if(n == 1)
{
cout<<"TAK";
break;
}
}
if(n > 1)
cout<<"NIE";

return 0;
}

0 comments on commit 774e2d9

Please sign in to comment.