杭电 2005 ( 第几天? ) java
来源:互联网 发布:净化网络环境的意义 编辑:程序博客网 时间:2024/06/16 17:51
import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int d[] = {0, 31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31}; while (sc.hasNext()) { String s = sc.next(); int days = 0; int year, month, day; String[] str = s.split("/"); year = Integer.parseInt(str[0]); month = Integer.parseInt(str[1]); day = Integer.parseInt(str[2]); if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0) && month > 2) { days++; } for (int i = 0; i < month; i++) { days = days + d[i]; } days += day; System.out.println(days); } }}
0 0
- 杭电 2005 ( 第几天? ) java
- 杭电 2005 第几天?
- 杭电 2005 第几天?
- 杭电2005第几天
- 2005 杭电 第几天?
- 杭电 2005 第几天?
- 杭电 2005 第几天
- 【杭电】[2005]第几天?
- 【杭电2005】第几天?
- 【杭电2005】第几天
- 杭电 2005 第几天?
- 【杭电】2005 第几天?
- 杭电2005 第几天
- 杭电2005 第几天?
- 杭电2005(第几天?)java字符串水过
- 杭电ACM 2005 第几天?
- 第几天?(杭电2005)
- 杭电ACM 2005: 第几天?
- C语言实验——单个字符输入和输出(顺序结构)(sdut oj)
- 2017年要学习的三个CSS新特性
- 数据库技术的基本概念与方法
- 打造 Recyclerview 的万能 Adapter CommonAdapter
- 【姿势】Build JSProject Like jQuery
- 杭电 2005 ( 第几天? ) java
- 纯css实现菱形◇变三角的小技巧
- 小改Spark sql,提升spark响应时间
- 多功能php绿色集成环境 700个PHP版本随时切换
- Docker入门之构建Springboot项目发布在镜像环境
- Oracle undo
- 关于项目介入VR功能简单介绍
- C++ 解析Json——jsoncpp
- BeanFactory和ApplicationContext联系和区别