import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner x = new Scanner(System.in); int month, day; month = x.nextInt(); day = x.nextInt(); int result = 0; int[] year = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; for (int i = 1; i < month; i += 1) {// 注意 i = 1 result += year[i - 1];// 注意这里的数组索引 } result += day; System.out.println(result); x.close(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:692 |
求圆的面积 (C语言代码)浏览:1707 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:515 |
数列问题 (C语言代码)浏览:1023 |
【偶数求和】 (C++代码)浏览:704 |
C语言程序设计教程(第三版)课后习题8.7 (C语言代码)浏览:527 |
哥德巴赫曾猜测 (C语言代码)浏览:729 |
用getchar()函数接收字符,正序输入为什么会倒序输出浏览:744 |
母牛的故事 (java语言代码)浏览:880 |
纪念品分组 (C++代码)浏览:839 |