Engineering & Technology
Mahasiswa
Terselesaikan
想請問專家 為什麼我先輸入0到100區間的分數都無法產生結果
【問題】C++程式碼問題要先輸入0<或>100讓他出跑出請在次輸入成績的程序 能否有專家能提點 dev c++
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void)
{
int score;
cout <<"請輸入成績";
cin >>score;
do{
if((score<0)||(score>100))
cout<<"成績輸入錯誤!請再輸入一次"<<endl;
cin>>score;
} while((score<0)||(score>100));
if((score>=80)&&(score<=100))
cout<<"成績優異!"<<endl;
if((score>=60)&&(score<80))
cout<<"成績尚可!"<<endl;
if((score>=0)&&(score<60))
cout <<"成績不及格!"<<endl;
system("pause");
return 0;
}
Answers
Apa kebingunganmu sudah terpecahkan?
Pengguna yang melihat pertanyaan ini
juga melihat pertanyaan-pertanyaan ini 😉