標題:
if...else 判斷式
[打印本頁]
作者:
tonyh
時間:
2015-8-11 15:00
標題:
if...else 判斷式
本帖最後由 tonyh 於 2015-8-11 15:27 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績: ";
cin>>score;
if(score>=60)
{
cout<<"恭喜你,及格了!"<<endl;
}else
{
cout<<"不及格.. 斬!"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
林禹彤
時間:
2015-8-11 15:20
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績:";
cin>>score;
if(score>=80)
{
cout<<"恭喜恭喜,紅包拿來:>"<<endl;
}else
{
cout<<"不及格,哈哈哈,笑你:)"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
陳品蓁
時間:
2015-8-11 15:22
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績:";
cin>>score;
if(score>=90)
{
cout<<"恭喜你及格了:"<<endl;
}else
{
cout<<"不及格...斬:"<<8endl;
}
system("pause");
return 0;
}
複製代碼
作者:
顏宇呈
時間:
2015-8-11 15:27
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"輸入你的成績";
cin>>score;
if(score>=60)
{
cout<<"好棒棒"<<endl;
}else
{
cout<<"去死吧!"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
鍾帛融
時間:
2015-8-11 15:32
// if...else 判斷式
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
柳晟緯
時間:
2015-8-11 15:43
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績:";
cin>>score;
if(score>=60)
{
cout<<"恭喜你,及格了!"<<endl;
}else
{
cout<<"不及格...斬!"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
張文擇
時間:
2015-8-11 15:45
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績:";
cin>>score;
if(score>=60)
{ cout<<"恭喜你,及格了!"<<endl;
}else
{
cout<<"不及格.. 斬!"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
柳晟緯
時間:
2015-8-11 16:14
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績:";
cin>>score;
if(score>=60)
{
cout<<"恭喜你,超優!"<<endl;
} if(score>=96)
{
cout<<"恭喜你,及格了!"<<endl;
} if(score>=60)
{
cout<<"不及格...加油!"<<endl;
} if(score<=60)
{
cout<<"超遜,斬!"<<endl;
} if(score<=20)
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2