string[] n={"景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
int[] s={90,65,88,70,46,81,100,68};
int sum=0;
double ave=0;
for(int i=0;i<s.Length;i++)
sum+=s[i];
ave = sum/s.Length;
Console.WriteLine("平均分是{0},高于平均分的有:",ave);
for(int i = 0;i<s.Length;i++)
{ if(s[i]>ave)
Console.Write(n[i]+" "); }
int[] s={90,65,88,70,46,81,100,68};
int sum=0;
double ave=0;
for(int i=0;i<s.Length;i++)
sum+=s[i];
ave = sum/s.Length;
Console.WriteLine("平均分是{0},高于平均分的有:",ave);
for(int i = 0;i<s.Length;i++)
{ if(s[i]>ave)
Console.Write(n[i]+" "); }
string[] name = {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int[] score = {89,90,98,56,60,91,93,85};
int max=0;
for(int i=0;i<score.Length;i++)
{ max= score[i]>score[max]?i:max;}
Console.Write("分数最高的是{0},分数是{1}",name[max],score[max]);
}
int[] score = {89,90,98,56,60,91,93,85};
int max=0;
for(int i=0;i<score.Length;i++)
{ max= score[i]>score[max]?i:max;}
Console.Write("分数最高的是{0},分数是{1}",name[max],score[max]);
}
int x;//循环计数变量
x=5;
while (true)//行② 请填写循环条件
{
Console.Write("加油!");
x-=1;
if(x<1)break;
}
两个while我都这么过的。。有点坑哦 哈哈啊
x=5;
while (true)//行② 请填写循环条件
{
Console.Write("加油!");
x-=1;
if(x<1)break;
}
两个while我都这么过的。。有点坑哦 哈哈啊
int year = 2015;//年份
string text;//请填写代码
text=(year%4)==0?"闰年":"平年";
Console.WriteLine("今年是{0}",text)
string text;//请填写代码
text=(year%4)==0?"闰年":"平年";
Console.WriteLine("今年是{0}",text)
2017-10-06