string[] ming = {"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關欣"};
int[] fen = {89,90,98,56,60,91,93,85};
int min=0;
for(int x =0; x< (fen.Length-1); x++)
{
if( fen[min] < fen[x+1] )
min = x+1;
}
Console.WriteLine("分數最高的是{0},分數是{1}",ming[min],fen[min]);
}
int[] fen = {89,90,98,56,60,91,93,85};
int min=0;
for(int x =0; x< (fen.Length-1); x++)
{
if( fen[min] < fen[x+1] )
min = x+1;
}
Console.WriteLine("分數最高的是{0},分數是{1}",ming[min],fen[min]);
}
char[,] ch = { {'我','是','軟'},{'件','工','程'},{'師','啦','!'}};
for(int a=0; a< ch.GetLongLength(0); a++ )
Console.Write("{0}{1}{2}",ch[a,0],ch[a,1],ch[a,2]);
我是軟件工程師啦!
God,你離成神已經不遠了!
for(int a=0; a< ch.GetLongLength(0); a++ )
Console.Write("{0}{1}{2}",ch[a,0],ch[a,1],ch[a,2]);
我是軟件工程師啦!
God,你離成神已經不遠了!
2017-12-28
string[] age = new string[4] ;//聲明并初始化長度為4的整形數組
//為數組元素賦值
age[0 ] = "18";
age[1 ] = "20";
age[2 ] = "23";
age[3 ] = "17";
Console.WriteLine("四名同學的年齡是:{0}、{1}、{2}、{3}",
age[0 ],age[1 ],age[2 ],age[3 ]);
//為數組元素賦值
age[0 ] = "18";
age[1 ] = "20";
age[2 ] = "23";
age[3 ] = "17";
Console.WriteLine("四名同學的年齡是:{0}、{1}、{2}、{3}",
age[0 ],age[1 ],age[2 ],age[3 ]);
2017-12-27
char sex='男';
int age = 21;
if(sex == '妖')
{ if (age >= 20) {Console.WriteLine("達到法定婚齡啦");
}
else {Console.WriteLine("沒有達到喲"); }
}
else
{ if (age >= 22) { Console.WriteLine("達到法定婚齡!"); }
else
{ Console.WriteLine("沒有達到!");
int age = 21;
if(sex == '妖')
{ if (age >= 20) {Console.WriteLine("達到法定婚齡啦");
}
else {Console.WriteLine("沒有達到喲"); }
}
else
{ if (age >= 22) { Console.WriteLine("達到法定婚齡!"); }
else
{ Console.WriteLine("沒有達到!");
2017-12-25