這有什么錯
string boy = "秀麗";//男孩名字 ? ? ? ? ? ?string girl = "偉強";//女孩名字 ? ? ? ? ? ?string temp;//中間變量 ? ? ? ? ? ?temp=boy;//把男孩的名字賦值給temp ? ? ? ? ? ?boy=girl;//把女孩的名字賦值給男孩 ? ? ? ? ? ?girl=temp;//把temp中的名字賦值給女孩 ? ? ? ? ? ?Console.WriteLine("男孩叫"+boy+" 女孩叫"+girl);
2018-06-07
我復制了你的代碼,重新跑了一遍
發現的錯誤就是你的代碼中有幾個分號寫成了中文的格式,你改下試試
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string boy = "秀麗";//男孩名字? ? ? ? ? ??
? ? ? ? ? ? string girl = "偉強";//女孩名字? ? ? ? ? ??
? ? ? ? ? ? string temp;//中間變量? ? ? ? ? ??
? ? ? ? ? ? temp=boy;//把男孩的名字賦值給temp? ? ? ? ? ??
? ? ? ? ? ? boy=girl;//把女孩的名字賦值給男孩? ? ? ? ? ??
? ? ? ? ? ? girl=temp;//把temp中的名字賦值給女孩? ? ? ? ? ??
? ? ? ? ? ? Console.WriteLine("男孩叫"+boy+" 女孩叫"+girl);
? ? ? ? }
? ? }
}
2018-04-16
沒有錯