# include<stdio.h>
int main()
{
int n;
int t;
int s=1;
printf("请输入一个整数:");
scanf("%d",&n);
for(t=1;t<=n;t++)//数的相乘,知道被乘数为n截止
{
s=s*t;
}
printf("%d的阶乘为%d",n,s);
return 0;
}
If you have any questions, please comment below and I will answer them for you.
c language: input an integer n, calculate n!
Guess you like
Origin blog.csdn.net/samxiaoguai/article/details/78473587
Ranking