24661人加入学习
(72人评价)
C#编程-第一季-编程基础-宇宙最简单2021最新版

制作完成于2021年10月10日,使用Visual Studio 2019

价格 免费

convert.toint32();把输入的字符转成整数类型 

convert.tochar();把输入的字符转成字符类型

[展开全文]
using System;

namespace _014_编程题
{
    class Program
    {
        static void Main(string[] args)
        {
            //int year = Convert.ToInt32(Console.ReadLine());

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


            //int number = Convert.ToInt32(Console.ReadLine());

            //if (number < 0)
            //{
            //    Console.WriteLine(0 - number);
            //}
            //else
            //{
            //    Console.WriteLine(number);
            //}


            //int a = Convert.ToInt32(Console.ReadLine());
            //int b = Convert.ToInt32(Console.ReadLine());
            //int c = Convert.ToInt32(Console.ReadLine());
            //int max = a;
            //if (b > max)
            //{
            //    max = b;
            //}
            //if (c > max)
            //{
            //    max = c;
            //}
            //Console.WriteLine(max * max);


            char a = Convert.ToChar(Console.ReadLine());
            char b = Convert.ToChar(Console.ReadLine());
            if (a > b)
            {
                Console.WriteLine("{0}>{1}", a, b);
            }
            else
            {
                Console.WriteLine("{0}<{1}", a, b);
            }
        }
    }
}

 

[展开全文]

Convert.ToChar

字符可以直接做大小比较

[展开全文]

授课教师

SiKi学院老师

课程特色

下载资料(1)
视频(118)
图文(1)