zoukankan      html  css  js  c++  java
  • 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();
                }
            }

  • 相关阅读:
    CSS hack:区分IE6,IE7,firefox
    十句CSS学习顺口溜
    div css表单布局的五个小技巧
    最常用的10种CSS BUG解决方法与技巧浏览器兼容教程
    最全的CSS浏览器兼容问题
    10款浏览器CSS Reset的方法
    [MySQL技巧]INSERT … ON DUPLICATE KEY UPDATE(转)
    新手写css常犯的8个错误
    如何在页面中插入播放器
    NicTeX 网络数学公式可视化编辑器
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4388097.html
Copyright © 2011-2022 走看看