標題:
if...else if...else 判斷式
[打印本頁]
作者:
歐柏罕
時間:
2017-10-16 19:45
標題:
if...else if...else 判斷式
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score =0;
cout<<"請輸入你的成績:"<<endl;
cin >> score;
if(score >= 60 && score <=100) //&&同時成立 (and) ||其中一14個成立就過 (or)
{
cout << "及格" << endl;
}
else if(score >=0 && score <60)
{
cout << "不及格" << endl;
}
else
{
cout << "輸入錯誤" << endl;
}
system("pause");
return 0;
}
複製代碼
作者:
曾堂桂
時間:
2017-10-16 19:48
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score=0;
cout<<"請輸入你的成績:"<<endl;
cin>>score;
if(score>=60&&score<=100)
{
cout<<"及格"<<endl;
}
else if(score>=0&&score<60)
{
cout<<"不及格"<< endl;
}
else
{
cout<<"輸入錯誤"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
沈子晏
時間:
2017-10-16 19:48
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score=0;
cout<<"請輸入你成績:"<<endl;
cin>>score;
if(score>=60 && score<=100)
{
cout<<"及格"<<endl;
}
else if(score>=0 && score<60)
{
cout<<"不及格"<<endl;
}
else
{
cout<<"輸入錯誤"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
彭煥宇
時間:
2017-10-16 19:49
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score=0;
cout<<"請輸入你的成績:"<<endl;
cin >> score;
if(score >= 60 && score <=100)
{
cout << "及格" << endl;
}
else if(score >=0 && score <60)
{
cout << "不及格" << endl;
}
else
{
cout << "輸入錯誤" << endl;
}
system("pause");
return 0;
}
複製代碼
作者:
盧佑芯
時間:
2017-10-16 19:51
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score = 0;
cout<<"請輸入你的成績:"<<endl;
cin >>score;
if(score>=60&&score<=100)
{
cout<<"及格"<<endl;
}
else if (score<=60&&score<=100)
{
cout<<"不及格"<<endl;
}
else
{
cout<<"輸入錯誤"<<endl;
}
system ("pause");
return 0;
}
複製代碼
作者:
洪翊庭
時間:
2017-10-16 20:05
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score=0;
cout<<"請輸入你的成績"<<endl;
cin>>score;
if(score>=60&&score<=100)
{
cout<<"及格"<<endl;
}
else if(score>=0&&score<60)
{
cout<<"不及格"<<endl;
}
else
{
cout <<"輸入錯誤"<<endl;
}
system("pause");
return 0;
複製代碼
作者:
盧佑恩
時間:
2017-10-16 20:09
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score = 0;
cout<<"請輸入你的成績:"<<endl;
cin >>score;
if(score>=60&&score<=100)
{
cout<<"及格"<<endl;
}
else if (score<=60&&score<=100)
{
cout<<"不及格"<<endl;
}
else
{
cout<<"輸入錯誤"<<endl;
}
system ("pause");
return 0;
}
複製代碼
作者:
洪翊展
時間:
2017-10-16 20:11
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score=0;
cout<<"我的成績:"<<endl;
cin>>score;
if(score>=60&&score>=100)
{
cout<<"及格"<<endl;
}
else if(score>=0)
{
cout<<"不及格"<<endl;
}
else
{
cout<<"輸入錯誤"<<endl;
}
system("pause");
return 0;
}
複製代碼
複製代碼
作者:
洪啓銓
時間:
2017-10-16 20:16
//W8QFR3uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyyyyyyyB67TBV97ewqrvyetqUYVR3IQR73YRUIEW6TEW//TLJEWTBI HREUGIRBWT
//
//
//
//REATJKYEW8GHTB UREWTB
//EWTBOREWUTNOIBY4W RHGFCNW
//REW8OYV UIRYG98TRFVUIR
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int g=0;
cout<<"請輸入你的成績:"<<endl; cin >> g;
if(g>=60 &&g<=100)
{
cout<<"及格了"<<endl;
}
else if(g>0 && g<60)
{cout<<"白癡"<<endl;}
else
{cout<<"自障+ 腦禪 "<<endl;}
system("pause");
return 0;
}
//W8QFR3uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyyyyyyyB67TBV97ewqrvyetqUYVR3IQR73YRUIEW6TEW//TLJEWTBI HREUGIRBWT
//
//
//
//REATJKYEW8GHTB UREWTB
//EWTBOREWUTNOIBY4W RHGFCNW
//REW8OYV UIRYG98TRFVUIR
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int g=0;
cout<<"請輸入你的成績:"<<endl; cin >> g;
if(g>=60 &&g<=100)
{
cout<<"及格了"<<endl;
}
else if(g>0 && g<60)
{cout<<"白癡"<<endl;}
else
{cout<<"自障+ 腦禪 "<<endl;}
system("pause");
return 0;
}
複製代碼
作者:
李治毅
時間:
2017-10-16 20:16
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score=10;
cout<<"報上成績來"<<endl;
cin>>score;
if(score>=60&&score<=100)
{
cout<<"你及格了"<<endl;
}
else if(score>=0&&score<60)
{
cout<<"可憐啊,人生難得有錯誤,加油吧"<<endl;
}
else
{
cout<<"恭喜你,你已經成為職業騙子了"<<endl;
}
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2