C#

xiaoxiao2021-02-28  24

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _100Moneye { class Class1 { static void Main() { int[] a=new int[10]{100,90,80,70,60,88,78,87,78,90}; int[] rember = new int[10]; double avge = 0, count = 0; for (int i = 0; i < 10; i++) { count += a[i]; } avge = count / 10.0; int j=0; for (int i = 0; i < 10; i++) { if (a[i] >= avge) { rember[j++] = a[i]; } } Console.WriteLine("the avge is:{0}",avge); Console.Write("those are:"); for (int i = 0; i < rember.Length; i++) { if (rember[i] > 0) { Console.Write(rember[i] + "\t"); } } } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _100Moneye { class Program { static void Main(string[] args) { for (int i = 0; i <= 100; i++) { //1kuai for (int j = 0; j <= 100; j++) {//5kuai for (int h = 0; h <= 100; h++) { //5mao if ((1 * i + 5 * j + 0.5 * h) == 100&&(i+j+h)==100) { Console.Write("1块:{0}\t5块:{1}\t5毛:{2}",i, j, h); Console.WriteLine(); } } } } } } }
转载请注明原文地址: https://www.6miu.com/read-2623246.html

最新回复(0)