标签:c
/* 求质因数 */ #include<stdio.h> #include<stdlib.h> int main() { int n,a=2; printf("please input n:"); scanf("%d",&n); if(n<=1) { printf("input error!\n"); return -1; } while(a*a < n) { while(n%a==0) { printf("%d ",a); n=n/a; } a++; } printf("%d\n",n); return 0; }
标签:c
原文地址:http://blog.csdn.net/zhangxxxww/article/details/26663047