• String 类;Math 类;


      static void Main(string[] args)
            {
                while (true)
                {
                   /* string x;
                    Console.WriteLine("请随便输入:");
                    x= Console.ReadLine();
                   x=x.Trim();//前边的空格和后面的空格都去掉


                    Console.WriteLine(x);
                     */

                   /* string x;
                    Console.WriteLine("请随便输入:");
                    x = Console.ReadLine();
                    int i = x.Length;  //字符串有多少位
                    Console.WriteLine(i);//注意这里输出的是数字
                    */

                    /*
                     string x;
                    Console.WriteLine("请随便输入:"); 
                    x = Console.ReadLine();
                    x=x.Replace(" ","");//替换成没有空格
                    Console.WriteLine(x);
                     */


                   /* string x;
                    Console.WriteLine("请随便输入:");
                    x = Console.ReadLine();
                    x = x.ToLower();   //把大写字母换成小写字母
                    Console.WriteLine(x);
                    */

                   /* string x;
                    Console.WriteLine("请随便输入:");
                    x = Console.ReadLine();
                    x = x.ToUpper();//把小写字母换成大写字母
                    Console.WriteLine(x);
                   */

                   /* string x, b, c, d; string e = "";
                   
                    Console.WriteLine("请输入您的身份证号:");
                     x=Console.ReadLine();
                    //e = x.Replace("约里克","我的身份证号是");
                   // Console.WriteLine(e);
                    b = x.Substring(6,4);
                    Console.WriteLine("您的出生年为"+b+"年");
                    c = x.Substring(10,2);
                    Console.WriteLine("您的出生月为" + c+"月");
                    d = x.Substring(12,2);               
                    Console.WriteLine("您的出生日为" + d+"日");
                    Console.WriteLine("您的出生年月日为"+b+"年"+c+"月"+d+"日");*/

                    /*double a, b;
                    Console.WriteLine("请输入一个小数:");
                    a = Convert.ToDouble(Console.ReadLine());
                    b = Math.Ceiling(a);//满足大于a的最小整数
                    Console.WriteLine(b);*/


                   /* double a, b;
                    Console.WriteLine("请输入一个小数:");
                    a = Convert.ToDouble(Console.ReadLine());
                    b = Math.Floor(a);//满足小于a的最大整数
                    Console.WriteLine(b);
                    */

                   /*double b,d;
                    b =Math.PI;//圆周率
                    d = Math.Round(b,3);//保留三位小数,四舍五入
                    Console.WriteLine(d);
                    */


                    /*double b, d,e;
                    Console.WriteLine("请随便输入一个数:");
                    b = Convert.ToDouble(Console.ReadLine());
                    d = Math.Sqrt(b);//平方根
                    Console.WriteLine(d);
                    e=Math.Round(d);//保留0位小数,四舍五入
                    Console.WriteLine(e);
                     */


                   /* int s;
                    DateTime dt = DateTime.Now;//获取当前系统的时间
                    Console.WriteLine(dt);
                    s = dt.DayOfYear;//今天是今年的第多少天
                    Console.WriteLine(s);
                    */
                   

                   /* int s;
                    DateTime dt = new DateTime();//将时间初始化
                    Console.WriteLine(dt);
                    */


                   /* string s = Console.ReadLine();
                    DateTime dt = new DateTime();
                    dt =Convert.ToDateTime(s);//转换为时间的格式
                    Console.WriteLine(dt.DayOfYear);//为本年的第几天
                    */
                    Console.ReadLine();
                }
            }

  • 相关阅读:
    js获取url参数值的方法总结
    Tomcat的配置与在IDEA上使用Tomcat
    windows配置并启动apache的方法
    图解 | 你管这破玩意叫计算机?
    【.NET 与树莓派】PWM 调节LED小灯的亮度
    【.NET 与树莓派】i2c(IIC)通信
    【.NET 与树莓派】矩阵按键
    【.NET 与树莓派】使用 GPIO 库
    【.NET 与树莓派】上手前的一些准备工作
    《红楼梦》最经典的12首诗词,读懂了才是人生
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4388097.html
Copyright © 2020-2023  润新知