萌新小白学习遇到问题,求各位大佬帮忙看一下哪里出错了?
这个是题目

package edu.exam;
import java.util.Scanner;
public class Exam1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
String Date;
Scanner in=new Scanner(System.in);
System.out.println("请按照XXXX-XX-XX格式输入一个生日日期");
Date=in.next();
String[] Dates=Date.split("-");
try{
int year=Integer.parseInt(Dates[0]);
int month=Integer.parseInt(Dates[1]);
int day=Integer.parseInt(Dates[2]);
}
catch(Exception e){
System.out.println("输入错误");
}
if((year>=1900)&&(year<=2013)){
if((month)>=1&&(month<=12)){
if((day>=1)&(day<=31)){
System.out.println("您的生日格式正确");
}
else{
System.out.println("日期格式不正确");
}
}
else{
System.out.println("月份格式不正确");
}
}
}
}
这个是出错的地方


package edu.exam;
import java.util.Scanner;
public class Exam1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
String Date;
Scanner in=new Scanner(System.in);
System.out.println("请按照XXXX-XX-XX格式输入一个生日日期");
Date=in.next();
String[] Dates=Date.split("-");
try{
int year=Integer.parseInt(Dates[0]);
int month=Integer.parseInt(Dates[1]);
int day=Integer.parseInt(Dates[2]);
}
catch(Exception e){
System.out.println("输入错误");
}
if((year>=1900)&&(year<=2013)){
if((month)>=1&&(month<=12)){
if((day>=1)&(day<=31)){
System.out.println("您的生日格式正确");
}
else{
System.out.println("日期格式不正确");
}
}
else{
System.out.println("月份格式不正确");
}
}
}
}
这个是出错的地方

...全文
相关推荐
解决pycharm运行出错,代码正确结果不显示的问题
本文将详细探讨如何解决“PyCharm运行出错,代码正确但结果不显示”的问题。
explorer出错
电脑上explorer经常出错,不知是什么原因?望各位高手鼎力相助!!谢谢!!
freetextbox 出错问题
### 出错问题概述根据题目描述,出现了"freetextbox出错问题"的情况,而具体的错误信息并未给出。
解决explorer.exe 应用程序出错 问题
**内存问题**:计算机内存故障也可能间接引起`explorer.exe`出错。#### 三、解决方案针对上述问题,我们提供以下几种可能的解决方案:1.
Electron 打包问题:electron-builder 下载各种依赖出错(推荐)
文章通过实际问题的解决过程,分享了解决electron-builder下载依赖出错的技巧和方法,这对于学习和工作中的Electron打包操作具有较高的参考价值。


