当前位置: 代码迷 >> 综合 >> HDOJ 1491 Octorber 21st
  详细解决方案

HDOJ 1491 Octorber 21st

热度:72   发布时间:2023-10-21 19:15:48.0

HDACM 1491
水题

import java.util.Scanner;public class Main {public static void main(String[] args) {int day[] = {
   31,28,31,30,31,30,31,31,30,31,30,31};Scanner sc = new Scanner(System.in);int t = sc.nextInt();while (t-->0) {int m = sc.nextInt();int d = sc.nextInt();int count = 0;if (m>10) {System.out.println("What a pity, it has passed!");continue;}if (m==10) {if (d==21) {System.out.println("It's today!!");continue;}if (d>21) {System.out.println("What a pity, it has passed!");continue;}}while (m<10) {count += day[m-1];m++;}System.out.println(count-d+21);}sc.close();}
}