Created
November 14, 2017 14:49
-
-
Save hansen033/3bd59ad861fe78de90b2134877a5b017 to your computer and use it in GitHub Desktop.
2017/11/09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
int plus, ans; | |
ans = 0; | |
cout << "請輸入想要加起來的數(想要減的話請用負數),輸入完成後請輸入0來取得答案\n"; | |
while (plus !=0){ | |
cin >> plus; | |
ans += plus; | |
} | |
cout << "\n答案是:" << ans; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment