zoukankan      html  css  js  c++  java
  • 取余取整取地板取天花板

    using System;
    using System.Collections.Generic;
    namespace ConsoleApp1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("(54/10):{0}", 54 / 10);
                Console.WriteLine("(56/10):{0}", 56 / 10);
                Console.WriteLine("(54.0%10.0):{0}", 54.0 % 10.0);
                Console.WriteLine("(56.0%10.0):{0}", 56.0 % 10.0);
                Console.WriteLine("Math.Celling(54.0/10.0):{0}", Math.Ceiling(54.0 / 10.0));
                Console.WriteLine("Math.Celling(56.0/10.0):{0}", Math.Ceiling(56.0 / 10.0));
                Console.WriteLine("Math.Floor(54.0/10.0):{0}", Math.Floor(54.0 / 10.0));
                Console.WriteLine("Math.Floor(56.0/10.0):{0}", Math.Floor(56.0 / 10.0));
                Console.ReadKey();
            }
        }
    }
    
    (54/10):5
    (56/10):5
    (54.0%10.0):4
    (56.0%10.0):6
    Math.Celling(54.0/10.0):6
    Math.Celling(56.0/10.0):6
    Math.Floor(54.0/10.0):5
    Math.Floor(56.0/10.0):5
  • 相关阅读:
    3185 队列练习 1 3186 队列练习 2
    1063 合并果子
    堆排序
    奇怪的电梯
    3411 洪水
    2010 求后序遍历
    1729 单词查找树
    3137 栈练习1
    2821 天使之城
    括弧匹配检验(check.cpp)
  • 原文地址:https://www.cnblogs.com/HansZimmer/p/15770235.html
Copyright © 2011-2022 走看看