The original Cat program only worked in terms of characters. It is more useful and more usual to read whole lines, but the FileReader doesn't have methods for reading anything other than characters. We need a BufferedReader that piggy-backs on top of the FileReader.
The original Cat program only worked in terms of characters. It is more useful and more usual to read whole lines, but the FileReader doesn't have methods for reading anything other than characters. We need a BufferedReader that piggy-backs on top of the FileReader.
The original Cat program only worked in terms of characters. It is more useful and more usual to read whole lines, but the FileReader doesn't have methods for reading anything other than characters. We need a BufferedReader that piggy-backs on top of the FileReader.
Now our loop is going to read whole lines which will be returned to us as Strings (a bit like 'gets()' in C).
Now our loop is going to read whole lines which will be returned to us as Strings (a bit like 'gets()' in C).
Now our loop is going to read whole lines which will be returned to us as Strings (a bit like 'gets()' in C).
We use the readLine() method of the BufferedReader object...
We use the readLine() method of the BufferedReader object...
We use the readLine() method of the BufferedReader object...
We use the readLine() method of the BufferedReader object...
We use the readLine() method of the BufferedReader object...
...and the terminating condition is whether the returned line is null or not.
...and the terminating condition is whether the returned line is null or not.
...and the terminating condition is whether the returned line is null or not.
This is a simple line copying program which is incidentally more efficient than the char-by-char copier that we had before.
If our file consists of integers, one per line, we can convert each String to an Integer wrapper object...
If our file consists of integers, one per line, we can convert each String to an Integer wrapper object...
If our file consists of integers, one per line, we can convert each String to an Integer wrapper object...
...and then we can extract an int from the Integer wrapper.
...and then we can extract an int from the Integer wrapper.
...and then we can extract an int from the Integer wrapper.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
Of course, converting the number may throw a NumberFormatException if your line is '46.5' or 'Z' or even (alas) ' 51'.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
You may have two integers on each line, so you will need to break up the line with a StringTokenizer (see the class library documentation for java.util.StringTokenizer for the complete story.
Let's make this more complicated: the second number on each line is a double!
Let's make this more complicated: the second number on each line is a double!
Let's make this more complicated: the second number on each line is a double!
Let's make this more complicated: the second number on each line is a double!
Let's make this more complicated: the second number on each line is a double!
And just to be on the safe side, the tokenizer will throw an exception if you don't put two tokens on each line! Tag another catch slause onto the existing try clause.
And just to be on the safe side, the tokenizer will throw an exception if you don't put two tokens on each line! Tag another catch slause onto the existing try clause.
And just to be on the safe side, the tokenizer will throw an exception if you don't put two tokens on each line! Tag another catch slause onto the existing try clause.
Finished code.
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
int c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
int c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
int c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
int c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
int c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=in.read())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=-1)
System.out.print((char)c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=-1)
System.out.println(c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=-1)
System.out.println(c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=-1)
System.out.println(c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null)
System.out.println(c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null)
System.out.println(c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null)
System.out.println(c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null)
System.out.println(c);
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
Integer bigI=new Integer(c);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
Integer bigI=new Integer(c);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
Integer bigI=new Integer(c);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
*Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
*int littleI=bigI.intValue();
System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
*System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
* }
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
*import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
*Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(c);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
*System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
int otherI=new Integer(st.nextToken()).intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
int otherI=new Integer(st.nextToken()).intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
int otherI=new Integer(st.nextToken()).intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
double otherD=new Integer(st.nextToken()).intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
double otherD=new Integer(st.nextToken()).intValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
double otherD=new Double(st.nextToken()).doubleValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
double otherD=new Double(st.nextToken()).doubleValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
double otherD=new Double(st.nextToken()).doubleValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
double otherD=new Double(st.nextToken()).doubleValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
catch(NoSuchElementException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}
import java.util.*;
import java.io.*;
public class Cat{
public static void main(String[] arg){
for(int i=0; i < arg.length; i++){
try{
File f=new File(arg[i]);
Reader in=new FileReader(f);
BufferedReader br=new BufferedReader(in);
String c;
while((c=br.readLine())!=null){
try {
StringTokenizer st=new StringTokenizer(c);
String s=st.nextToken();
Integer bigI=new Integer(s);
int littleI=bigI.intValue();
double otherD=new Double(st.nextToken()).doubleValue();
System.out.println(littleI*2);
}
catch(NumberFormatException e){System.err.println(e);}
catch(NoSuchElementException e){System.err.println(e);}
}
}
catch(IOException e){System.err.println(e);}
}
}
}