题目描述
LZ is a lazy and tiresom man. One day, LZ was asked by his lovely niece, Amy, to find out all the divisors of number N. LZ wants to get rid of his niece's border so he wants to tell her the answer as soon as possible. And LZ is so lazy that he decides to turn to you for help.
As the smartest NEU coder, you recepts this question and solves it in only one minute... OMG~~
输入
The first line of the input file has a number T which indicates that there will be T test cases following. Each test case only contains a number N.
0<=T<=1000 1<=N<=10^8
输出
Each output case only contains an integer which is the number of divisors N has.
样例输入
3
10
12
8
样例输出
4
6
4
提示
来源
#include<stdio.h>
#include<math.h>
int main()
{
int n,i,j,k,num=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&k);
for(j=1;j<=sqrt(k);j++)
{if(k%j==0)
num++;}
if(sqrt(k)==(int)sqrt(k))
printf("%d\n",2*num-1);
else printf("%d\n",2*num);
num=0;
}
return 0;
}