這個(gè)代碼哪里出問(wèn)題了,執(zhí)行不了
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string today;//今天的午飯
? ? ? ? ? ? string tomorrow;//明天的午飯
? ? ? ? ? ? string temp;//聲明一個(gè)空變量
? ? ? ? ? ? today = "魚(yú)香肉絲";
? ? ? ? ? ? tomorrow = "小雞燉蘑菇";
? ? ? ? ? ? temp = today;//替換到空變量
? ? ? ? ? ? today = tomorr;//tomorrow的值替換到today
? ? ? ? ? ? tomorrow = temp;//完成替換
? ? ? ? ? ? //打印
? ? ? ? ? ? Console.WriteLine("我今天吃{0},明天吃{1}。",today,tomorrow);
? ? ? ? }
? ? }
}
2022-10-20
是tomorrow不是tomorr
2021-05-12
tomorr
2021-03-29
today = tomorr;//tomorrow的值替換到today
這一行中的tomorrow漏了”ow“。