Thursday, 8 May 2014

SPOJ Problem Set (classical) 9948. Will it ever stop Problem code: WILLITST

//http://www.spoj.com/problems/WILLITST/

#include<stdio.h>
#include"string.h"
int main()
{

    long long int x;
    scanf("%lld",&x);
    if(((x != 0) && ((x & (~x + 1)) == x)))    //checks for 2^n
        printf("TAK\n");
    else
        printf("NIE\n");
    return 0;
}

No comments:

Post a Comment