string.......; int[] cj = new int[] { 90, 65, 88, 70, 46, 81, 100, 68 }; int sum = 0, avg; for (int i = 0; i < cj.Length; i++) { sum += cj[i]; }avg = sum / cj.Length;Console.WriteLine("平均分是{0},高于平均分的有:", avg);
for (int i = 0; i < cj.Length; i++){ if (cj[i] > avg) {Console.Write(name[i] + " ");}}
for (int i = 0; i < cj.Length; i++){ if (cj[i] > avg) {Console.Write(name[i] + " ");}}
string[] names =new string[]{"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int[] score=new int[]{89,90,98,56,60,91,93,85};
int max = score[0];
int x =0;
for(int i=1;i<score.Length;i++){ if(score[i]>max){ max = score[i]; x = i; } }
Console.WriteLine("分数最高的是{0},分数是{1}", names[x], score[x]);
int[] score=new int[]{89,90,98,56,60,91,93,85};
int max = score[0];
int x =0;
for(int i=1;i<score.Length;i++){ if(score[i]>max){ max = score[i]; x = i; } }
Console.WriteLine("分数最高的是{0},分数是{1}", names[x], score[x]);
int year = 2015;//年份
Console.WriteLine(year/4&year%4);//求年份除以4的余数
Console.WriteLine(year/4&year%4);//求年份除以4的余数
2017-07-02