最赞回答 / 慕斯卡3158314
namespace Test{ class Program { static void Main(string[] args) { string boy = "秀丽";//男孩名字 string girl = "伟强";//女孩名字 string temp;//中间变量 temp="秀丽";//把男孩的名字赋值给temp boy=girl; //把女孩的名字赋...
2018-06-26
说一个不需要temp变量就可以实现交换的办法
int a=12;
int b = 23;
a = a +b;
b=a - 2 *b;
a = (a -b)/2;
b= b + a;
int a=12;
int b = 23;
a = a +b;
b=a - 2 *b;
a = (a -b)/2;
b= b + a;
2018-06-24
已采纳回答 / LeahDizon
你这个步骤有一些是多余的。。。而且思路好像错了。。我把主要代码告诉你吧。for(i=0;i<b.Length;i++){ sum+=b[i];}avge=sum/b.Length;Console.WriteLine("平均分是"+avge+","+"高于平均分的有");for(i=0;i<b.Length;i++){ if(b[i]>avge){ Console.Write(a[i]+" "); }}
2018-06-14
最赞回答 / 慕粉9455790
string[,] info = new string[8, 2] { { "吴松", "89" }, { "钱东宇", "90" }, { "伏晨", "98" }, { "陈陆", "56" }, { "周蕊", "60" }, { "林日鹏", "9" }, { "何昆", "93" }, { "关欣", "85" } }; int temp=0; for(int i=0;i<info.GetLongLength(0);i++) ...
2018-06-12