輸入 x 後 算出 x * (x - 1) +2
答案:
include<iostream>using namespace std;int main(){ { int x; while (cin >> x) {
cout << x * (x - 1) + 2 <<"\n"; }}}
輸入 x 後 算出 x * (x - 1) +2 答案: includeusing namespace std;int main(){ { int x; while (cin >> x) { cout << x * (x - 1) + 2 <<"\n"; }}}
includeusing namespace std;int main(){ { int x; while (cin >> x) {
如果遇到1就會錯了