課程
/后端開發
/C#
/C#開發輕松入門
如何自己選擇
2016-07-15
源自:C#開發輕松入門 3-2
正在回答
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int score = 94;//分數
? ? ? ? ? ? if(score>95)//判斷
? ? ? ? ? ? ? ? {//分支1
? ? ? ? ? ? ? ? ? ? Console.WriteLine("獎勵一輛自行車");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else//分支2
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ?Console.WriteLine("要啥自行車");
? ? ? ? }
? ? }
}
現在你應該知道了吧,告訴我們唄= =我也是輸入94的時候還是顯示獎勵
看看是不是在if語句后面加了分號“;”?
if (score>95)
你可能寫成了if(score>=95)
慢走
是不是帶等號了?
這個有沒有代碼呢?
舉報
本門課程是C#語言的入門教程,將帶你輕松入門.NET開發
9 回答不知道為什么我輸出的是輸出錯誤
1 回答輸出(Console.Write), 輸入(Console.Read) 到底是什么 不太懂
1 回答輸出結果為什么只有一個??
3 回答輸入大于10的數字時,第一個if 和else都輸出了,怎么回事
3 回答這個為什么輸出不對
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-10-23
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int score = 94;//分數
? ? ? ? ? ? if(score>95)//判斷
? ? ? ? ? ? ? ? {//分支1
? ? ? ? ? ? ? ? ? ? Console.WriteLine("獎勵一輛自行車");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else//分支2
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ?Console.WriteLine("要啥自行車");
? ? ? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2017-12-25
現在你應該知道了吧,告訴我們唄= =我也是輸入94的時候還是顯示獎勵
2017-10-12
看看是不是在if語句后面加了分號“;”?
2016-07-16
if (score>95)
{
}
你可能寫成了if(score>=95)
2016-07-15
是不是帶等號了?
2016-07-15
這個有沒有代碼呢?