返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int total =0;
  6.     int i;
  7.     for(i=1; i<11; i+=1)
  8.     {
  9.             total = total+i;
  10.     }
  11.     cout<<total;
  12.      cout<<endl;   
  13. system("pause");   
  14. return 0;      
  15. }
複製代碼

TOP

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int total =0;
  6.     int i;
  7.     for(i=1; i<101; i+=1)
  8.     {
  9.             total = total+i;
  10.     }
  11.     cout<<total;
  12.      cout<<endl;   
  13. system("pause");   
  14. return 0;      
  15. }
複製代碼

TOP

返回列表