Inputing strings
public int inputInt() throws IOException
{
int k=0;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
str = br.readLine();
k = Integer.parseInt(str);
return k;
}
For inputing integers
public int inputInt() throws IOException
{
int k=0;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
str = br.readLine();
k = Integer.parseInt(str);
return k;
}
No comments:
Post a Comment