for (int x = 1; x <= 7; x++)
{
Console.Write(x);
if(x==y)
break;
{
Console.Write(x);
if(x==y)
break;
2018-04-16
for(int i=0;i<score.Length;i++)
{
if(score[i]>max)
{
max=score[i];
x=i;
}
}
Console.WriteLine("分數最高的是{0},分數是{1}",name[x],score[x]);
{
if(score[i]>max)
{
max=score[i];
x=i;
}
}
Console.WriteLine("分數最高的是{0},分數是{1}",name[x],score[x]);
string[] name=new string[]{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關欣"};
int[] score=new int[]{89,90,98,56,60,91,93,85};
int x=0;
int max=0;
int[] score=new int[]{89,90,98,56,60,91,93,85};
int x=0;
int max=0;
namespace Test
{
class Program
{
static void Main(string[] args)
{
int y = 5;
while ( y <=5 && y >= 1 )//請輸入
{
Console.Write(y+" ");
y--;//請輸入
}
}
}
}
{
class Program
{
static void Main(string[] args)
{
int y = 5;
while ( y <=5 && y >= 1 )//請輸入
{
Console.Write(y+" ");
y--;//請輸入
}
}
}
}
2018-04-14
string[] name ={"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關欣"};
int[] score = {89,90,98,56,60,91,93,85};
for (int i=1;i<score.Length;i++)
{
if (score[0]<score[i])
{
score[0]=score[i];
name[0]=name[i]
}
int[] score = {89,90,98,56,60,91,93,85};
for (int i=1;i<score.Length;i++)
{
if (score[0]<score[i])
{
score[0]=score[i];
name[0]=name[i]
}
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
//*第一行,y為1,x只循環一次,只為1,
//*第二行,y為2,x只循環二次,為12.
//*以此類推。。。
{ Console.Write(x); }
Console.WriteLine();
{
for (int x = 1; x <= y; x++)
//*第一行,y為1,x只循環一次,只為1,
//*第二行,y為2,x只循環二次,為12.
//*以此類推。。。
{ Console.Write(x); }
Console.WriteLine();
2018-04-10