sorry for posting here,because in Java there is no one can help me.
how could I input v & t;
[java]import java.io.*;
public class sample
{
public static void main(String args[])
{
int v,t;
v=intRead();
t=intRead();
System.out.println(2*v*t);
}
}[/java]
Thanks.
or just tell me how to input float,double .
Anyone who use Java?
Moderator: Board moderators
Anyone who use Java?
AC makes me feels good,
But WA makes me thinks hard.
But WA makes me thinks hard.
I'm not a Java user on this site, so I don't even know if the Judge supports the following (I doubt it actually), but normally, one could do something like this:
[java]import java.io.*;
public class Sample
{
private static BufferedReader stdin =
new BufferedReader (new InputStreamReader (System.in));
public static void main (String[] args)
throws IOException
{
String input = stdin.readLine ();
int number = Integer.parseInt (input);
System.out.println (number);
}
}[/java]
This would only get one number PER line. If you knew there was more than one number on a line, then you would need to use (with the above methodoloy, though there's got to better ways!) StringTokenizer to parse the "input" string into it's component parts, and you can then parse each token however you want.
I also believe there's a thread about ACMIO.java (or something like that) around here somewhere too. You might want to take a look at that as well.[/java]
[java]import java.io.*;
public class Sample
{
private static BufferedReader stdin =
new BufferedReader (new InputStreamReader (System.in));
public static void main (String[] args)
throws IOException
{
String input = stdin.readLine ();
int number = Integer.parseInt (input);
System.out.println (number);
}
}[/java]
This would only get one number PER line. If you knew there was more than one number on a line, then you would need to use (with the above methodoloy, though there's got to better ways!) StringTokenizer to parse the "input" string into it's component parts, and you can then parse each token however you want.
I also believe there's a thread about ACMIO.java (or something like that) around here somewhere too. You might want to take a look at that as well.[/java]
-
- New poster
- Posts: 15
- Joined: Fri Aug 08, 2003 8:13 pm
- Location: Russia, Moscow
- Contact:
Re: Anyone who use Java?
Zhao Le, take a look at this thread.
www.Find-a-Drug.org distributed computing project