http://ac.jobdu.com/problem.php?pid=1087
照抄了 http://blog.csdn.net/jdplus/article/details/18353667
#include <stdio.h>
#include <cmath>
int main(){
//freopen("in/1087.in","r",stdin);
int n;
int a[1001];
while(scanf("%d",&n)!=EOF && n ){
for (int i = 0; i < n; ++i) {
scanf("%d", &a[i]);
}
for (int i = 0; i < n; ++i) {
int cnt = 0;
int root =(int) sqrt(a[i]*1.0);
for (int j = 1; j <=root; j++) {
if(a[i]%j == 0){
cnt +=2;
}
}
if(root * root == a[i]) cnt--;
printf("%d\n",cnt);
}
}
}