C語言源碼: [cpp] #include<stdio.h> #include<math.h> int num(int n) { int m,i,b; m=0; i=2; if(n==2) return 1; b=(int)sqrt(n)+1; while(i<=b) { if(n%i==0) { m+=num(i)+num(n/i); break; } i++; } if(i>b) m++; return m; } int main() { int n; while(scanf("%d",&n)!=EOF) printf("%d\n",num(n)); }