闰年判断
来源:互联网 发布:微商城 源码 编辑:程序博客网 时间:2024/05/17 02:03
//输入一个年份,判断是否十闰年。
using System;
namespace leap_ear
{
class LeapYear
{
static void Main(string[] args)
{
int year;
Console.WriteLine("Enter your year:");
year = Convert.ToInt32(Console.ReadLine()); //Console.ReadLine()转换为int
/* if (((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
{
Console.WriteLine("{0} is leap year!", year);//按照格式字符串的格式输出
}
else
{
Console.WriteLine("{0} is not leap year!", year);
}*/
if (DateTime.IsLeapYear(year))
Console.WriteLine("{0} is leap year!", year);
else
Console.WriteLine("{0} is not leap year!", year);
Console.ReadKey(); //等待按下任意键,一次读入一个字符。
}
}
}
- 判断闰年 输出闰年
- 判断闰年
- 判断闰年
- 闰年判断
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 判断闰年
- 闰年判断
- 判断闰年
- Error: Library projects cannot set applicationId. applicationId is set to "com.du.android.recyclervi
- 【转】自己总结的web前端知识体系大全
- 技术人生,从此记录成长的点滴
- python(第二版)第二章答案
- 软件工程基础知识
- 闰年判断
- hdu4899 dp套dp
- 简单的实现 Js和java交互
- solr6.0配置中文分词器IK Analyzer
- 条件注释判断浏览器<!--[if !IE]><!--[if IE]><!--[if lt IE 6]><!--[if gte IE 6]>
- Swift3中dispatch_once废弃的解决办法
- 【1024程序员节】我们的世界不只0和1
- GDI绘图之画图
- ADB 命令常用命令