原题:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1087
思路:
打表找规律
剩下的题我明天下午发
源代码:
#include <cstdio> int n,k,tmp,count1; int main() { scanf("%d",&n); for (int i=1;i<=n;i++) { scanf("%d",&k); tmp=1; count1=0; while (tmp<k) { count1++; tmp+=count1; } if (tmp==k) printf("1\n"); else printf("0\n"); } return 0; }