第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

換個寫法,隨便寫寫

?string[] name = {"景珍","林惠洋","成蓉","洪南昌","龍玉民","單江開","田武山","王三明"};

? ? ? ? ? ? int[] score = {90,65,88,70,46,81,100,68};

? ? ? ? ? ? int avg = 0;

? ? ? ? ? ? int sum = 0;

? ? ? ? ? ? int j = 0;

? ? ? ? ? ? foreach ( int i in score )

? ? ? ? ? ? ? ? sum += i;

? ? ? ? ? ? avg = sum / score.Length;

? ? ? ? ? ? Console.WriteLine("平均分是"+ avg + ",高于平均分的有:");

? ? ? ? ? ? foreach (int i in score) {

? ? ? ? ? ? ? ? if ( i > avg ) {

? ? ? ? ? ? ? ? ? ? Console.Write(name[j] + " ");

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? j++;

? ? ? ? ? ? }


正在回答

2 回答

? ? ? ? ? ? string[] name = new string[] { "景珍", "林惠洋","成蓉", "洪南昌", "龍玉明", "單江開", "田武山", "王三明" };

? ? ? ? ? ? int[] sum = new int[] { 90, 65, 88, 70, 46, 81, 100, 68 };

? ? ? ? ? ? Console.Write("平均分是76,高于平均分的有:");

? ? ? ? ? ? for (int i = 0; i < sum.Length; i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? if (sum[i] > 76)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? Console.Write(name[i]+" ");

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }


0 回復 有任何疑惑可以回復我~

using System;

using System.Collections.Generic;

using System.Text;


namespace projAboveAvg

{

? ? class Program

? ? {

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? string[] name = {"景珍","林惠洋","成蓉","洪南昌","龍玉民","單江開","田武山","王三明"};

? ? ? ? ? ? int[] number = {90,65,88,70,46,81,100,68};

? ? ? ? ? ? int sum = 0,agv;

? ? ? ? ? ? for(int i=0;i<name.Length;i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? sum +=number[i];

? ? ? ? ? ? }

? ? ? ? ? ? agv = sum/number.Length;

? ? ? ? ? ? Console.Write("平均分是{0},高于平均分的有:",agv);

? ? ? ? ? ? for(int i = 0;i<name.Length;i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? if(number[i]>agv)

? ? ? ? ? ? ? ? ? ? Console.Write(name[i]+' ');

? ? ? ? ? ? }

? ? ? ? }

? ? }

}


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
C#開發(fā)輕松入門
  • 參與學習       255638    人
  • 解答問題       1519    個

本門課程是C#語言的入門教程,將帶你輕松入門.NET開發(fā)

進入課程

換個寫法,隨便寫寫

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號