最近在自学c语言 这是一个计算阶乘的练习 调试了好多次还是不行。。求大神讲解
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
double factorial(double a, double b ,double c ){
return (double c);}
int main(int argc, char** argv) {
cout << "Input a number: ";
cin >>b;
for (a=1,c=1;a<=b;a++,c=a*(a+1));
cout << "The factorial is: " << factorial(c);
system("PAUSE");
return 0;
}
谢谢大神