java程序改错。急急急!

来源:百度知道 编辑:UC知道 时间:2024/06/22 09:24:51
import java.io.*;
public class Q2
{
public static void main(String args[])throws IOException
{
int year=0,month=0;
string s="",t="";
try{
System.out.println("请输入年份:(如 2008)");
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
s=in.readLine();
}catch(IOException e){};
year=Integer.parseInt(s)
try{
system.out.println("请输入月份:(如 1)");
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
t=in.readLine();
}catch(IOException e){}
month=Integer.parseInt(t);
if(month==2)
{if((year%4==0&&year%100!=0)||year%400==0) System.out.println("二月份有29天");
else System.out.println("二月份有28天");}
else
switch(month)
{
case 1:System.out.p

import java.io.*;
public class Q2
{
public static void main(String args[])throws IOException
{
int year=0,month=0;
String s="",t=""; //String的S大写
try{
System.out.println("请输入年份:(如 2008)");
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
s=in.readLine();
}catch(IOException e){};
year=Integer.parseInt(s); //你忘了加分号
try{
System.out.println("请输入月份:(如 1)"); //System的S要大写
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
t=in.readLine();
}catch(IOException e){}
month=Integer.parseInt(t);
if(month==2)
{if((year%4==0&&year%100!=0)||year%400==0) System.out.println("二月份有29天");
else System.out.println("二月份有28天");}
else
switch(month)
{
case 1:System.out.println("一月份31天");break;
case 3:System.out.println("三月份31天");break; <