課程
/后端開發(fā)
/C#
/C#開發(fā)輕松入門
24行的代碼看不懂特別是{0}{1}
2017-09-15
源自:C#開發(fā)輕松入門 2-8
正在回答
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string today;//今天的午飯
? ? ? ? ? ? string tomorrow;//明天的午飯
? ? ? ? ? ? string temp;//中間變量
? ? ? ? ? ? today = "魚香肉絲";
? ? ? ? ? ? tomorrow = "小雞燉蘑菇"
? ? ? ? ? ? //請(qǐng)?jiān)谶@里補(bǔ)充代碼,實(shí)現(xiàn)變量today和tomorrow的交換
? ? ? ? ? ? temp = today;//今天的午飯賦值給temp
? ? ? ? ? ? today = tomorrow;//明天的午飯賦值給今天
? ? ? ? ? ? tomorrow = temp;//temp賦值給明天
? ? ? ? ? ??
? ? ? ? ? ? //打印
? ? ? ? ? ? Console.WriteLine("我今天吃{0},明天吃{1}。",today,tomorrow);
? ? ? ? }
? ? }
}
就這樣,還不對(duì)一比一看那錯(cuò)了,注意符號(hào)不要用成中文的了。都沒錯(cuò)好不對(duì)就是這個(gè)編譯器的問(wèn)題不用管了,自己會(huì)了就好。
這個(gè)的正確答案是把后面的變量換一下就對(duì)了,一個(gè)職業(yè)坑新手的網(wǎng)站課程
qq_慕運(yùn)維0487080
都是錯(cuò)的,這個(gè)就是勸你不要學(xué)c#了
string temp?
? ? ? ? ? ? temp = today;
? ? ? ? ? ? today = tomotrrw;
? ? ? ? ? ? tomorrow = temp;
0和1就是占位符
在下面添加,string box;
box=today;
today=tomorrow;
tommorrmow=box;
精慕門9207190 提問(wèn)者
小孩子_0001 回復(fù) 精慕門9207190 提問(wèn)者
qq_高仔_mrzIQ5
舉報(bào)
本門課程是C#語(yǔ)言的入門教程,將帶你輕松入門.NET開發(fā)
3 回答編程求解
2 回答編程實(shí)現(xiàn)1+2+…+100的和
2 回答編程問(wèn)題
2 回答3-6編程題
2 回答4-9編程題
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)
2018-12-19
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string today;//今天的午飯
? ? ? ? ? ? string tomorrow;//明天的午飯
? ? ? ? ? ? string temp;//中間變量
? ? ? ? ? ? today = "魚香肉絲";
? ? ? ? ? ? tomorrow = "小雞燉蘑菇"
? ? ? ? ? ? //請(qǐng)?jiān)谶@里補(bǔ)充代碼,實(shí)現(xiàn)變量today和tomorrow的交換
? ? ? ? ? ? temp = today;//今天的午飯賦值給temp
? ? ? ? ? ? today = tomorrow;//明天的午飯賦值給今天
? ? ? ? ? ? tomorrow = temp;//temp賦值給明天
? ? ? ? ? ??
? ? ? ? ? ? //打印
? ? ? ? ? ? Console.WriteLine("我今天吃{0},明天吃{1}。",today,tomorrow);
? ? ? ? }
? ? }
}
就這樣,還不對(duì)一比一看那錯(cuò)了,注意符號(hào)不要用成中文的了。都沒錯(cuò)好不對(duì)就是這個(gè)編譯器的問(wèn)題不用管了,自己會(huì)了就好。
2018-12-19
這個(gè)的正確答案是把后面的變量換一下就對(duì)了,一個(gè)職業(yè)坑新手的網(wǎng)站課程
2018-12-19
都是錯(cuò)的,這個(gè)就是勸你不要學(xué)c#了
2018-07-10
string temp?
? ? ? ? ? ? temp = today;
? ? ? ? ? ? today = tomotrrw;
? ? ? ? ? ? tomorrow = temp;
2018-01-05
0和1就是占位符
2017-09-15
在下面添加,string box;
box=today;
today=tomorrow;
tommorrmow=box;