求助大神
求分解质因数 看看呢个地方出错了#include<stdio.h>int main()
{
int n,b,c,i,flog;
scanf("%d",&n);
flog=1;
for(i=2;i<n;i++)
{
if(n%i==0)
b=i;
for(c=2;c<b;c++)
{
if(b%c==0)
flog=0;
else
flog=1;
}
if(flog)
printf("%d ",b);
}
printf("\n");
return 0;
}
2012-12-12 09:43
程序代码:#include<stdio.h>
int main()
{
int i, n, temp;
scanf("%d",&n);
temp = n;
while (1)
{
for (i = 2;i < temp;i++)
if (temp % i == 0)
break;
if (i == temp)
{
printf("%d = %d\n", temp, n);
break;
}
printf("%d * ", i);
temp /= i;
}
return 0;
}

2012-12-12 10:13