标签:
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
int t;
scanf("%d",&t);
while(t--){
int n;
scanf("%d",&n);
int k = sqrt(double((n - 1) * 2 + 1.0 / 4)) - 0.5;
if(k * (k + 1) == (n - 1) * 2){
puts("1");
}else puts("0");
}
return 0;
}
[2016-05-11][51nod][1087 1 10 100 1000]
标签:
原文地址:http://www.cnblogs.com/qhy285571052/p/dc53c3286205fd3eafe0b056429024d7.html