日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > C# >内容正文

C#

c# 类 时间

發布時間:2024/8/24 C# 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c# 类 时间 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
三、類 namespace String_類_Math_類_ {class Program{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;Console.WriteLine("請輸入一個小數:");a = Convert.ToDouble(Console.ReadLine());int b = Convert.ToInt32(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();}}} }

?

轉載于:https://www.cnblogs.com/w-wz/p/4439663.html

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的c# 类 时间的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。