Leap Years
Description:
In this kata you should simply determine, whether a given year is a leap year or not. In case you don't know the rules, here they are:
- years divisible by 4 are leap years
- but years divisible by 100 are no leap years
- but years divisible by 400 are leap years
Additional Notes:
- Only valid years (positive integers) will be tested, so you don't have to validate them
Examples can be found in the test fixture.
using System; public static class Kata
{
public static bool IsLeapYear(int year)
{
// TODO
bool flag = false;
if (year % == )
{
if (year % == )
{
if (year % == )
{
flag = true;
}
}
else
{
flag = true;
}
}
return flag;
}
}
其他人的解法:物体吐槽了,.net自带了相关的函数
using System; public static class Kata
{
public static bool IsLeapYear(int year)
{ return DateTime.IsLeapYear(year);
}
}
Leap Years的更多相关文章
- 第一个Leap Motion测试页面 (webgl/three/leapjs/leap)
div#canvas-frame{ border: none; cursor: pointer; width: 100%; height: 800px; background-color: #EEEE ...
- HTC Vive 与Leap Motion 出现位置错误的问题
Leap Motion已经支持VR, 但是官方没有支持HTC Vive的例子. 按照官方的文档, 其实是有问题的: https://developer.leapmotion.com/documenta ...
- 到底AR初创公司Magic Leap是不是骗子?我看未必
AR技术和VR技术在今年的发展可谓是日新月异,眼看年末已至,不成想却出现了大新闻.最炙手可热的神秘AR初创公司Magic Leap被硅谷付费媒体The Information(付费读者大多为硅谷资深投 ...
- Leap Motion发布新平台,直击下一代移动端VR/AR手部追踪
2013年,动作捕捉技术公司Leap Motion发布了面向PC的体感控制器,不过销量并不乐观.随着2014年虚拟现实技术的再一次兴起,它发布一款用于Oculus Rift的附加设备,从而正式登上VR ...
- 安装 openSUSE Leap 42.1 之后要做的 8 件事
导读 openSUSE Leap 确实是个巨大的飞跃,它允许用户运行一个和 SUSE Linux 企业版拥有同样基因的发行版.和其它系统一样,为了实现最佳的使用效果,在使用它之前需要做些优化设置. 下 ...
- leap motion
体感控制器: 识别:手,手指和工具,获取位置,手势,动作 范围:倒金字塔,塔尖在设备中心,2.5cm~0.6米 坐标系统:采用右手笛卡尔积坐标系,返回的数值:毫米 摆放:绿灯朝向自己,z轴距离屏幕越来 ...
- Unity3D中使用Leap Motion进行手势控制
Leap Motion作为一款手势识别设备,相比于Kniect,长处在于准确度. 在我的毕业设计<场景漫游器>的开发中.Leap Motion的手势控制作为重要的一个环节.以此,谈谈开发中 ...
- Leap Motion 开发笔记
Leap Motion 体系架构 Leap Motion支持所有主流操作系统,leap motion在Windows系统下是作为一个服务运行的,在Mac和Linux是后台守护进程.软件通过USB线连接 ...
- Ventuz配置Leap Motion环境
1.下载Leap Dev Kit 前往官网www.leapmotion.com,下载相应平台的开发包,目前PC版的最新版本为2.3.1. SDK里包含了Leap Motion的安装包,上图第二个.安装 ...
随机推荐
- Merge Into For Update Example
Merge Into article aa Using ( SELECT md5_id, Min(article_id) as Min_Article_ID from article )) and s ...
- 第十二篇、HTML常用框架收集
1.Swiper 广告轮播插件 2.Bootstrap 响应式布局 3.jQuery js兼容插件 4.jQuery Mobile 5.phoneGap
- 基于微软EnterpriseLib的框架(一)
1.框架模型无ORM,重点在数据库建模设计与UI框架设计上 2.多数据库支持(Enterprise Lib 默认仅支持SqlServer和Oracle,需自己扩展才能支持其他数据库,本文已扩展SQLi ...
- myeclipse-8.6.0下载
myeclipse老版本不分32位和64位,欢迎大家下载使用! 链接:http://pan.baidu.com/s/1dEJCxcl 密码:z1ga
- Python爬虫第一集
import urllib2 response = urllib2.urlopen("http://www.baidu.com") print response.read() 简单 ...
- bzoj3208:花神的秒题计划I
思路:因为Q.S.B操作总和不超过100,因此怎么暴力怎么写....当然记忆化搜索还是要的 #include<cstdio> #include<iostream> #inclu ...
- MFC: Create Directory
Original link: How to check if Directory already Exists in MFC(VC++)? MSDN Links: CreateDirectory fu ...
- OpenJudge 2757 最长上升子序列 / Poj 2533 Longest Ordered Subsequence
1.链接地址: http://poj.org/problem?id=2533 http://bailian.openjudge.cn/practice/2757 2.题目: 总Time Limit: ...
- inline-block的兼容性问题
inline-block的兼容性问题 Inline-block是元素display属性的一个值.这个名字的由来是因为,display设置这个值的元素,兼具行内元素( inline elements)跟 ...
- c/c++中的各种字符串转换
一:CString 和 *char 的转换: 1:CString -> *char 1)CString转化为*char可以使用CString中的GetBuffer()函数,具体如下: CStri ...