#include<iostream.h>
int Fac(int x,int y);
int s=1;
void main()
{
int a,b,c=0;
cout<<"Please input two numbers!!(TYPE int)"<<endl;
cin>>a>>b;
c=Fac(a,b);
cout<<"Rusult is:"<<c<<"\n";
}
int Fac(int x,int y)
{
while(y!=0)
{
s*=x;
Fac(x,y-1);
}
return s;
}
试试这样行不行,应该可以的
当你开始怀疑自己时,说明你已经失去了判断力