restricted function??

Write here if you have problems with your Java source code

Moderator: Board moderators

Post Reply
taz
New poster
Posts: 1
Joined: Wed Aug 15, 2007 2:40 pm

restricted function??

Post by taz » Wed Aug 15, 2007 2:43 pm

Hi there,

I am having serious frustrations getting the input in.
its a simple input ==> 2 integers.

It compiles and runs fine locally but not here...

Using bufferedreader and tokenizer is sending restricted function messages (i guess). I've tried shifting things inside and outside, making things static or not etc.
Can someone please tell me whats wrong with the following basic input code?
And how to fix it???

import java.io.*;
import java.util.*;
class Main
{
static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

public static void main (String[] args)
{
try{
StringTokenizer st = new StringTokenizer(in.readLine());
int nu1 = Integer.parseInt(st.nextToken());
int nu2 = Integer.parseInt(st.nextToken());
}
catch(IOException x){}
}
}

thanks
Taz

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko » Wed Aug 15, 2007 8:24 pm

There is a topic with exactly the same title (including the number of question marks) on this very page. I know that using Java here is really frustrating, but you should at least try to look for the answers before posting a question.

Oh, well...
- UVa "Java" is Java 1.1 with a lot of things removed (gcj makers claim it is 1.2, but I haven't seen a single thing from 1.2)
- Most of java.io.* is restricted, including BufferedReader
- You can write your own read/write routines (and some of them are posted around here), but I would suggest waiting for their new system, it seems to be almost done and will fully support newest Java. The link is available at the main page( http://acm.uva.es/problemset/ ).

Post Reply

Return to “Java”