zoukankan      html  css  js  c++  java
  • ArrayList 练习

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Collections;
    namespace arrayLIST练习
    {
        class Program
        {
    
            static void Main(string[] args)
            {
                ArrayList A = new ArrayList();
                Console.WriteLine("请输入人数:");
                int B = int.Parse(Console.ReadLine());
                for (int C = 0; C < B; C++)
                {
                    Console.WriteLine("请输第" + C + 1 + "个人数的成绩:");
                    A.Add(int.Parse(Console.ReadLine()));
                }
    
    
                double SUM = 0;
    
                for (int Z = 0; Z < B; Z++)
                {
                    SUM += double.Parse(A[Z].ToString());
                }
                double AVE = SUM / B;
                Console.WriteLine("平均分数:" + AVE);
    
    
                A.Sort();
                for (int c = 0; c < B; c++)
                {
                    Console.WriteLine(A[c]);
                   
                }
             
                Console.ReadLine();
            }
    
        }
    }
    

      

  • 相关阅读:
    Scala-函数
    Scala--循环
    scala(一)
    拦截器filter
    Ajax实现分页二
    并发1
    泛型
    协议protocol
    结构体structure
    类的继承
  • 原文地址:https://www.cnblogs.com/hanke123/p/4725860.html
Copyright © 2011-2022 走看看