#include <bits/stdc++.h> using namespace std; unsigned fac(unsigned n) { unsigned f; if(n==0) f=1; else f=fac(n-1)*n; return f; } int main() { unsigned n; cout<<"Enter a positive integer: "; cin>>n; unsigned y=fac(n); cout<<n<<"!="<<y<<endl; return 0; }
标签:std,5.4,cout,unsigned,fac,打卡 From: https://www.cnblogs.com/Sunyiran/p/17371614.html