| ||||||||||
| 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 | |||||||||
好像用hasNext可以吧In Reply To:请教一下用java如何结束输入(hasnextint()这个函数是错的) Posted by:ylsq at 2005-08-10 14:40:23 > 我做这题目提交一直是提示Runtime Error不知道是哪的问题,请各位帮忙看一下:
> import java.io.*;
> import java.util.*;
> public class Main
> {
> public static void main(String arg[])throws Exception
> {
> Scanner cin=new Scanner(System.in);
>
> while(cin.hasNextInt())
> {int n=cin.nextInt();
>
> float[] resx=new float[n];
> float [] resy=new float[n];
> int prex=cin.nextInt();
> int stox=prex;
> int prey=cin.nextInt();
> int stoy=prey;
> for(int i=0;i<n-1;i++)
> {
> int x=cin.nextInt();
> int y=cin.nextInt();
> .........
> }
> ........
> }
> }
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator