赞
踩
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
double Accumulator(double iniN,double endN){
double result = 1;
if(iniN > endN){
cout<<"error"<<endl;
return -1;
}
cout <<"the iniN is:"<<iniN<<"\nthe endN is:"<<endN<<endl;
while(iniN <= endN){
result *= iniN;
iniN = iniN+1;
}
cout<<"the result is:"<<result<<endl;
return result;
}
int main() {
Accumulator(-10,-9);
return 0;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。