第一個還有點看得懂,但後面的就不太懂了
unsigned int x;
unsigned int jc = 1;
cout << "請輸入一個非負整數:" << endl;
cin >> x;
while (x)
{
jc *= x;
x--;
}
cout << "x!=" << jc << endl;
int n = 1;
int jc = 1;
float e = 0.0;
int i = 0;
cout << "請輸入求和項數:" << endl;
cin >> n;
while (i < n)
{
if (i == 0)
jc = 1;
else
jc *= i;
i++;
e += 1.0 / jc;
}
cout << "數學常量e=" << e << endl;
第三個類似的,不多說