string[] names =new string [] { "吳淞", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關欣" };
int[] score = new int []{ 89, 90, 98, 50, 60, 91, 93, 85 };
int y = 0;
int a = 0;
for(int i=0;i<names.Length;i++)
{
if (y<score[i])
{
y = score[i];
a = i;
}
}
Console.WriteLine("分數最高的是" + names[a]+",分數是" + score[a]);
int[] score = new int []{ 89, 90, 98, 50, 60, 91, 93, 85 };
int y = 0;
int a = 0;
for(int i=0;i<names.Length;i++)
{
if (y<score[i])
{
y = score[i];
a = i;
}
}
Console.WriteLine("分數最高的是" + names[a]+",分數是" + score[a]);
\\這個答案有什么問題嗎,提交不了。
if(money>=100000)
{Console.WriteLine("送一臺微波爐");}
else if(money>=50000)
{Console.WriteLine("送一套茶具");}
else if(money>=10000)
{Console.WriteLine("送一袋大米");}
else
{Console.WriteLine("沒有禮品");}
if(money>=100000)
{Console.WriteLine("送一臺微波爐");}
else if(money>=50000)
{Console.WriteLine("送一套茶具");}
else if(money>=10000)
{Console.WriteLine("送一袋大米");}
else
{Console.WriteLine("沒有禮品");}
namespace Test
{
class Program
{
static void Main(string[] args)
{
int x;
for ( x=1;x<=12;x++)//請填寫代碼
{
Console.WriteLine(x+" ");
}
}
}
}
{
class Program
{
static void Main(string[] args)
{
int x;
for ( x=1;x<=12;x++)//請填寫代碼
{
Console.WriteLine(x+" ");
}
}
}
}
2016-10-10
static void Main(string[] args)
{
string[] name = {"關羽","張飛","趙云","馬超","黃忠"};
for(int i=0;i<name.Length;i++){
Console.Write(name[i]+",");
}
}
{
string[] name = {"關羽","張飛","趙云","馬超","黃忠"};
for(int i=0;i<name.Length;i++){
Console.Write(name[i]+",");
}
}