标签:int \n || NPU submit center input main 数据
1 2
2
使用递归函数求n!
int fact(int n)
{
}
#include<stdio.h> int fact(int n) { int result; if(n==1||n==0) result=1; else result=n*fact(n-1); return result; } int main() { int n,t; scanf("%d",&t); while(t--) { scanf("%d",&n); printf("%d\n",fact(n)); } return 0; }
标签:int \n || NPU submit center input main 数据
原文地址:https://www.cnblogs.com/chenlong991223/p/10132860.html