※ 引述《sowaterking (這淒涼何人能解)》之銘言:
: 這是我想的方法
: 可是好像到30!左右就不準了
: 到34!就變0了
: 這是什麼原因呢
: 要如何改善
: 謝謝
: #include<iostream>
: using std::cin;
: using std::cout;
: using std::endl;
: int main()
: {
: long result = 1;
: long j;
: cout << "enter integer\n";
: cin >> j;
: for (long i = 1; i <= j; i++ )
: result = result * i;
: cout << j << "! is " << result << endl;
: return 0;
: }
好麻煩的感覺@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.250.133