day2

44 阅读1分钟

image.png

image.png

image.png

image.png

image.png

using System;

![image.png](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/458b2e38ec1848e7952ddf5fb0d8d129~tplv-k3u1fbpfcp-watermark.image?)
namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            //int number = Convert.ToInt32(Console.ReadLine());
            //Console.WriteLine("{0}的十位数是{1},个位数是{2}",number, number / 10, number % 10);
            //int number = Convert.ToInt32(Console.ReadLine());
            //Console.WriteLine(number%10 + "" + number / 10 % 10 + number / 100);
            Test7();
        }
        static void Test1() {
            int score = Convert.ToInt32(Console.ReadLine());
            if (score >= 90 && score <= 100)
            {
                Console.WriteLine("A");
            }
            else if (score >= 70 && score <= 89)
            {
                Console.WriteLine("B");
            }
            else if (score >= 60 && score <= 69)
            {
                Console.WriteLine("C");
            }
            else if (score < 60)
            {
                Console.WriteLine("D");
            }
            else {
                Console.WriteLine("成绩无效");
            }
        }
        static void Test2() { 
            int x = Convert.ToInt32(Console.ReadLine());
            int y = Convert.ToInt32(Console.ReadLine());
            if (x == 0 && y == 0)
            {
                Console.WriteLine("该点在原点");
            }
            else if (x == 0)
            {
                Console.WriteLine("该点在y轴");
            }
            else if (y == 0)
            {
                Console.WriteLine("该点在x轴");
            }
            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("该点在第四象限");
                }
            }
        }
        static void Test3() { 
            int a = Convert.ToInt32(Console.ReadLine());
            int b = Convert.ToInt32(Console.ReadLine());
            int c = Convert.ToInt32(Console.ReadLine());
            if (a + b > c && a + c > b && b + c > a) {
                Console.WriteLine("yes");
            }
            else {
                Console.WriteLine("no");
            }

        }
        static void Test4()
        {
            int year = Convert.ToInt32(Console.ReadLine());
            if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                Console.WriteLine("yes");
            }
            else
            {
                Console.WriteLine("no");
            }
        }
        static void Test5() { 
            int number = Convert.ToInt32(Console.ReadLine());
            if (number < 0)
            {
                Console.WriteLine("负数");
            }
            else {
                Console.WriteLine("正数");
            }
            Console.WriteLine(Math.Abs(number));
        }
        static void Test6() { 
            int max = Convert.ToInt32(Console.ReadLine());
            max = Math.Max(max, Convert.ToInt32(Console.ReadLine()));
            max = Math.Max(max, Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine(max*max);
        }
        static void Test7() {
            int a = Console.Read();
            Console.ReadLine();
            int b = Console.Read();
            Console.WriteLine("{0}>{1}",(char)Math.Max(a,b), (char)Math.Min(a,b));
        }
    }
}

image.png

image.png