A1061. 求因子个数
时间限制:1.0s 内存限制:512.0MB
问题描述
给定一个正整数n,求它的因子个数。
输入格式
只有一行,为正整数n。其中n<=100000。
输出格式
只有一行,为n的因子个数。
样例输入
6
样例输出
4这个题目感觉表述有问题,不过程序测试就是这样。
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int n;
- while(scanf("%d",&n)!=EOF){
- int count=0;
- for(int i=1;i<=n;i++){
- if(n%i==0)
- count++;
- }
- printf("%d\n",count);
- }
- system("pause");
- return 0;
- }
1155

被折叠的 条评论
为什么被折叠?



