https://www.cnblogs.com/longhai3/longhai

C语言>>阶乘+整数因子

Posted on 2022-02-12 19:36  凡是过去,皆为序曲  阅读(28)  评论(0编辑  收藏  举报

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/w1hg/331817