解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void S(int Y,int M,int D){
int[] array = {31,28,31,30,31,30,31,31,30,31,30,31};
int sum = 0;
for(int i=0;i<M-1;i++)
sum +=array[i];
sum+=D;
if(Y%4==0&&Y%100!=0||Y%400==0)
if(M!=2)
sum+=1;
System.out.print(sum);
}
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
int Y = sc.nextInt();
int M = sc.nextInt();
int D = sc.nextInt();
S(Y, M, D);
}
}
0.0分
0 人评分
图形输出 (Java代码)浏览:810 |
小九九 (C语言代码)浏览:503 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:621 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:526 |
C二级辅导-公约公倍 (C语言代码)浏览:1429 |
C二级辅导-统计字符 (C语言代码)浏览:470 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:410 |
三角形 (C++代码)递归(存在大量重复计算,容易出现时间超限)浏览:718 |
The 3n + 1 problem (C语言代码)浏览:501 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:553 |