快捷导航

日期时间都对应得上,但有个问题,为啥只有2019年4月第一行的空白的

package java基础.万年历制作;
import java.util.Scanner;
public class Calader{
public static void main(String[] args) {
        while (true) {
        int sum = 0;
       Scanner sc = new Scanner(System.in);
       System.out.println("查询的年份");
       int year = sc.nextInt();
      System.out.println("查询的月份");
      int month = sc.nextInt();

   for (int i = 1900; i < year; i++) {
        if (i % 400 == 0 || (i % 100 != 0 && i % 4 == 0)) {
                sum += 366;
             } else {
                         sum += 365;
                   }
     }
          int currentDay = 0;// 当月天数
         int totalDay = 0;// 当前年份到当前月份的总天数
         for (int i = 1; i

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

做的没什么问题,这是输出的问题,2019年4月的 week =0,然后 blank=0;然后就
System.out.println()
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP