C#入门6——年历显示

这篇博客介绍了如何使用C#语言来创建一个显示年历的程序,适合初学者学习。通过阅读,读者可以了解到C#的基础语法以及如何进行日期和时间的操作,掌握控制台应用程序开发的基本技巧。
摘要由CSDN通过智能技术生成
using System;

namespace day0530
{
   
    class Program
    {
   
        static void Main(string[] args)
        {
   
             Console.WriteLine("请输入年份");
            int year =  int.Parse(Console.ReadLine());
           // int month=1;
           // int day=1;
            //int week=GetWeekByDay(year,month,day);

            //bool leapYear = IsLeapYear(year);

            WriteYear(year);



            Console.ReadLine();
        }

        /*private static void Fun1()
        {
            Console.WriteLine("Fun1被开始执行了!");
            string str = "012345!";
            string name1 = str.Remove(3);//去除第3位之后的数据
            Console.WriteLine(str);

            string name2= str.Replace('3','9');//把字符'3'换成'9'
            Console.WriteLine(str);

            bool bo1= str.StartsWith('0');//判断字符串的第一个字符是否为'0'
            Console.WriteLine(str);

            bool bo2=str.Contains('6');//判断字符串中是否含有字符'6'
            Console.WriteLine(str);

            Console.WriteLine("name1="+name1+ ",name2=" + name2 + ",bol1=" + bo1 + ",bol2=" + bo2);
            Console.WriteLine("Fun1被执行完成了!");
            //Console.ReadLine();
        }
        */

        private static  void WriteYear(int year)
        {
   
            
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值