Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- long long int n,k,i,j,x,sq,r;
- scanf("%lld",&n);
- for(i=1;i<=n;i++){
- scanf("%lld",&k);
- x=(k-1)*2;
- sq=sqrt(x);
- r=sq*(sq+1);
- if(r==x)
- printf("1");
- else
- printf("0");
- if(i==n)
- printf("\n");
- else
- printf(" ");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement