#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
printf("这是一个求n!的程序,请输入n:");
int n;
scanf("%d",&n);
int i=0,jiecheng=1;
loop:if(i<n)
{
i++;
jiecheng*=i;
goto loop;
}
printf("%d",jiecheng);
return 0;
}
C语言 用if goto求n!
最新推荐文章于 2023-02-16 09:08:37 发布