最新回答 / qq_夏日秋冥
这样理解:1.“从右向左” 说的是变量的赋值过程,比如说从程序中截取的这段代码,示例:x = y = 2;//从右向左赋值,x、y的值都是2 解释:2先赋值给y,之后y再赋值给x。这就完成了整个语句的赋值过程。2.”加赋值“+=“ 是一种运算符,示例:int a = 2; a+=2; Console.wrintline(a);解释:示例程序运行第二句时,将a+2的值重新赋给a,所以运行结果,a的值为4。
2016-01-12
Console.WriteLine("{0}{1}{2}", ch[1,1], ch[1, 2], ch[2, 0]);
2016-01-12
string[] t =new string[]{"C","Sh","a","rp"}; //遍历字符串数组t
foreach (string x in t)
{
Console.Write(x);
}
foreach (string x in t)
{
Console.Write(x);
}
2016-01-12
int[] score = new int[] {89,39,100,51,94,65,70 };//分数
Console.Write("不及格的有:");
for (int i = 0; i < 7; i++)
{
if(score[i]<60 )//筛选条件
Console.Write(score[i]+",");
Console.Write("不及格的有:");
for (int i = 0; i < 7; i++)
{
if(score[i]<60 )//筛选条件
Console.Write(score[i]+",");
2016-01-12