A problem is easy
时间限制: 1000 ms | 内存限制: 65535 KB
难度: 3
- 描述
- When Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1 cup of water plus 1 pile of dough ..” , “100 yuan buy 100 pig” .etc..
- 输入
- The first line contain a T(T <= 2000) . followed by T lines ,each line contain an integer N (0<=N <= 10^11). 输出
- For each case, output the number of ways in one line 样例输入
-
213
样例输出 -
01
上传者 -
1 #include
2 #include 3 4 int main() 5 { 6 int T; 7 scanf("%d",&T); 8 while(T--) 9 {10 int i,j,t,n;11 int num=0;12 scanf("%d",&n);13 for(i=1;i<=sqrt((double)n)+1;i++)14 {15 if((n-i)%(i+1)==0)16 if((n-i)/(i+1)>=i)17 num++;18 }19 printf("%d\n",num);20 }21 return 0;22 } 优秀代码:
#include
#include #include