F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_31645408_8343\Main.java:1: 错误: 解析时已到达文件结尾
import java.util.*;class Main{    public static void main (String args[]){    Scanner sc = new Scanner(System.in);    while(sc.hasNext()){        String str = sc.nextLine();          String[] date = str.split("/"); //解析出 年 月 日        int n = Integer.parseInt(date[0]);          int y = Integer.parseInt(date[1]);          int r = Integer.parseInt(date[2]);          int t = 0;//<span style="font-family: Arial, Helvetica, sans-serif;">是一月份就只要加日,是二月份就要把第一月份的天数(31)加上再加上日,是三月份就要把第一、二月份的天数(31+28)再加上日以此推</span>            switch(y){                case 1 : t+=r;break;                case 2: t+=31+r;break;                case 3: t+=59+r;break;                case 4: t+=90+r;break;                case 5: t+=120+r;break;                case 6: t+=151+r;break;                case 7: t+=181+r;break;                case 8: t+=212+r;break;                case 9: t+=243+r;break;                case 10: t+=273+r;break;                case 11: t+=304+r;break;                case 12: t+=334+r;            }        if((n%400==0||(n%4==0&&n%100!=0))&&y>2)<span style="font-family: Arial, Helvetica, sans-serif;">//闰年判断,闰年要多加一天</span>        System.out.println(t+1);        else System.out.println(t);    }}}
                                                                                                                                                                                                                      ^
0_0_31645408_8343\Main.java:2: 错误: 解析时已到达文件结尾
2 个错误


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-15 23:38:35, Gzip enabled