返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.     int one = 0, two = 0 , a = 0;
  6.     re:
  7.     cout << "請輸入第一個數 : ";
  8.     cin >> one;
  9.     cout << "請輸入第二個數 : ";
  10.     cin >> two;
  11.     for (int i = one, i <= two , i++){
  12.         a = one + 1;
  13.     }
  14.     cout << "從" << one << "到" << two << "所有整數的總和為 : " << a << endl;
  15.     cout << endl;
  16.     goto re;
  17.     system("pause");
  18.     return 0;
  19. }
複製代碼

TOP

返回列表