作业

#include <iostream>
using namespace std;

int jiecheng(int num){
    int f;
    if(num==1)
    f=1;
    else
    f=jiecheng(num-1)*num;
    return f;
}
int main(){
    int n=5;
    cout<<jiecheng(n)<<endl;
    return 0;
}

posted @ 2017-11-06 18:51  羿龙  阅读(72)  评论(0编辑  收藏  举报