第三次学习

50 阅读1分钟

using System; using System.Collections

namespace MyConsoleSpp1 {

internal class Program
{
    public static void Main(String[] args)
    {


        /*int a = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine(a);


        ArrayList list = new ArrayList();
        list.Add(1);
        list.Add(2);
           list.Add(3);

        foreach (int i in list) {
            Console.WriteLine(i);
        }*/

        /*
         分数等级判断
         */
        /*int num = Convert.ToInt32(Console.ReadLine());

        switch (num)
        {
            case 100:
            case 90:
                Console.WriteLine("您的等级为:A");
                break;
            case 89:
            case 70:
                Console.WriteLine("您的等级为:B");
                break;
            case 69:
            case 60:
                Console.WriteLine("您的等级为:C");
                break;
            default:
                Console.WriteLine("您的等级为:D");
                break;
        }*/

        /*
         判断象限
         */

        /*
       int x = Convert.ToInt32(Console.ReadLine());
       int y = Convert.ToInt32(Console.ReadLine());

      if (x > 0 && y > 0)
       {
           Console.WriteLine("第一象限");

       }
       else if (x < 0 && y > 0)
       {
           Console.WriteLine("第二象限");

       }
       else if (x < 0 && y < 0)
       {
           Console.WriteLine("第三象限");

       }
       else if (x > 0 && y < 0)
       {
           Console.WriteLine("第四象限");

       }
       else
       {
           Console.WriteLine("原点");
       }

*/

        /*
         日期判断
         */

        /*
         编写一个程序。对输入的4个整数,求出最大值和最小值
         */

        /*int[] arr = new int[4];
        for (int i = 0; i < 4; i++)
        {
            arr[i] = Convert.ToInt32(Console.ReadLine());
        }

        int max = arr[0];
        int min = arr[0];
        for (int i = 0; i < 4; i++)
        {
            if (arr[i] > max)
            {
                max = arr[i];
            }
            if (arr[i] < min)
            {
                min = arr[i];

            }
        }*/

        int num = 0;
        int n = 0;
        num = Convert.ToInt32(Console.ReadLine());
        int max = num;
        int min = num;
        while (n < 3)
        {
            num = Convert.ToInt32(Console.ReadLine());
            if(num > max)
            {
                max = num;
            }
            if (num < min) {
                min = num;
            }
            n++;
        }

        Console.WriteLine("最大值为{0},最小值为{1}",max,min);

        /*
         闰年判断
         */
        /* int year = Convert.ToInt32(Console.ReadLine());

         if (year % 4 == 0 && year % 100 != 0) {
             Console.WriteLine(year + "是闰年");
         } else if (year % 400 == 0) {
             Console.WriteLine(year + "是闰年");
         }
         else
         {
             Console.WriteLine(year + "不是闰年");

         }*/

    }
}

}