# c021 用do while算總分 ###### tags: `c`  --- #include<iostream> using namespace std; //do while算總分 main(){ int n=0,sum=0; do{ sum=sum+n; cout<<"輸入成績:-1結束"<<endl; cin>>n; }while(n!=-1); cout<<"總分為:"<<sum; return 0; }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up