n阶乘
#include<stdio.h>
int main()
{
int a,b=1,n;
scanf("%d",&n);
for(a=1;a<=n;a++)
{
b=b*a;
}
printf("%d",b);
return 0;
}
=====================================================================
整数因子
#include<stdio.h>
int main()
{
int a,b;
scanf("%d",&b);
for(a=1;a<=b;a++)
{
if(b%a==0)
printf("%d\n",a);
}
return 0;
}
#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=
本文来自博客园,作者:凡是过去,皆为序曲,转载请注明原文链接:https://www.cnblogs.com/longhai3/p/15887177.html
如有疑问,欢迎提问
#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=