| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
最后一行n--干吗?In Reply To:2894这么简单的题怎么会出错?大家帮忙看一下那里不行:) Posted by:daryl at 2006-07-24 20:38:30 > import java.io.*;
> import java.util.*;
>
> public class Main {
> public static void main(String args[]) throws IOException {
> BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
> int light[] = new int[1001];
> String ch = new String();
> int a, b;
> String str = new String();
> int n = Integer.parseInt(br.readLine());
> while(n-- >= 0) {
> int t = Integer.parseInt(br.readLine());
> for(int s = 0; s < 1001; s++)
> light[s] = 0;
> while(t-- > 0) {
> str = br.readLine();
> StringTokenizer st = new StringTokenizer(str);
> ch = st.nextToken();
> a = Integer.parseInt(st.nextToken());
> b = Integer.parseInt(st.nextToken());
> for(int i = a; i < b; i++)
> light[i]++;
> }
> for(int j = 0; j < 1001; j++)
> {
> if(light[j] != 0)
> System.out.print(""+(char)('@'+light[j]));
> System.out.flush();
> }
>
> System.out.println("");
> n--;
> }
> }
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator