标签:
阅读题。。加上等差数列判断。。
#include<cstdio> #include<cmath> int n,s; int main(){ while(scanf("%d",&n)&&n!=-1){ n--; if (n%6){printf("N\n");continue;} n/=3; s=int (sqrt(double(n))); if (s*(s+1)==n)printf("Y\n"); else printf("N\n"); } }
标签:
原文地址:http://www.cnblogs.com/moris/p/4322098.html