ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1209. 1, 10, 100, 1000...

whats wrong????????
Posted by shailendrasky 27 Dec 2013 01:52
#include <stdio.h>
int main()
{
   long int k,a,n;
   scanf("%ld",&n);
   while(n--)
   {


   scanf("%ld",&k);
   a=1;
   while(k-a>0)
    k=k-(a++);
   if(k==1)
    printf("1\n");
   else
    printf("0\n");
   }
}






Edited by author 27.12.2013 01:54