C#入门记录04

这一部分主要记录下运算符相关的东西

/*
 2020年3月4日22:28:49
 运算符相关的东西
 使用Math来进行相关的数据计算
 */

using System;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            int i = 8;
            int j = 3;

            //使用Math函数
            //Console.WriteLine(Math.Sin(i * i + j * j));

            //求余运算
            int result = i % j;
            Console.WriteLine(result.ToString());


            Console.ReadKey();
        }
    }
}

因为运算符计算的东西 和C C++的都比较类似,这里暂不记录

区别是C#中的大类System包含了许多的类库 不用像 C/C++需要包含math头文件

猜你喜欢

转载自blog.csdn.net/Wuzm_/article/details/104812402