課程
/后端開(kāi)發(fā)
/C#
/C#開(kāi)發(fā)輕松入門
如果用3層的if嵌套? 如何打代碼?
2017-09-17
源自:C#開(kāi)發(fā)輕松入門 3-6
正在回答
if(sorce>=90)?//手機(jī) else?if(sorce>=80)?//滑板 else?if(sorce>=60)?//燒餅 else?//沒(méi)有獎(jiǎng)勵(lì) //自己加輸出會(huì)吧
static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? while (true) {?
? ? ? ? ? ? ? ? int score = 0;
? ? ? ? ? ? ? ? Console.WriteLine("\n輸入成績(jī)(輸入-1退出)");
? ? ? ? ? ? ? ? score = int.Parse(Console.ReadLine());
? ? ? ? ? ? ? ? if (score>=90)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("手機(jī)");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if(score>=80&&score<90)
? ? ? ? ? ? ? ? ? ? Console.WriteLine("滑板");
? ? ? ? ? ? ? ? else if(score>=60&&score<80)
? ? ? ? ? ? ? ? ? ? Console.WriteLine("燒餅");
? ? ? ? ? ? ? ? else if(score>=0&&score<60)?
? ? ? ? ? ? ? ? ? ? Console.WriteLine("沒(méi)有獎(jiǎng)勵(lì)");
? ? ? ? ? ? ? ? else if (score == -1)?
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? }
? ? ? ? }
舉報(bào)
本門課程是C#語(yǔ)言的入門教程,將帶你輕松入門.NET開(kāi)發(fā)
2 回答編程問(wèn)題
2 回答4-9編程題
6 回答2-8的編程題求解
1 回答為何3-6點(diǎn)提交沒(méi)反應(yīng)???
2 回答4-10編程題怎么做呀?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-09-17
2017-09-17
static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? while (true) {?
? ? ? ? ? ? ? ? int score = 0;
? ? ? ? ? ? ? ? Console.WriteLine("\n輸入成績(jī)(輸入-1退出)");
? ? ? ? ? ? ? ? score = int.Parse(Console.ReadLine());
? ? ? ? ? ? ? ? if (score>=90)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("手機(jī)");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if(score>=80&&score<90)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("滑板");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if(score>=60&&score<80)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("燒餅");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if(score>=0&&score<60)?
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("沒(méi)有獎(jiǎng)勵(lì)");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else if (score == -1)?
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }