   1 //c2java.java
   2 import java.io.*;
   3 import java.util.*;
   4 //You can extends this class ..
   5 // .. so that you can quickly translate your C into Java program
   6 class c2java {
   7    BufferedReader cin = null;
   8    PrintStream cout = null;
   9    PrintStream cerr = null;
  10    c2java( ) { prepareIO( );  } // constructor
  11    void prepareIO( ) {
  12       try {
  13        cin = new BufferedReader(
  14         new InputStreamReader(System.in) );
  15       }catch(Exception e) {;}
  16       cout = System.out;
  17       cerr = System.err;
  18    }
  19    void printf(String fmt, Object... oo) {
  20         System.out.printf(fmt, oo); 
  21    }//printf
  22    void print(String fmt, Object... oo) {
  23         System.out.printf(fmt, oo); 
  24    }
  25    void println(String fmt, Object... oo) {
  26         System.out.printf(fmt+"\n", oo); 
  27    }//println
  28    int atol(String s) {   // atoi, atol
  29       int ans = 0;
  30       try {
  31         ans = Integer.parseInt(s);
  32       }catch(Exception e) { ; }
  33       return ans;
  34    }//atol
  35    double atof(String s) {
  36       double ans = 0;
  37       try {
  38         ans = Double.parseDouble(s);
  39       }catch(Exception e) { ; }
  40       return ans;
  41    }//atof
  42    int rand( ) {
  43       return (int) ( Math.random() * (1.0 + Integer.MAX_VALUE) );
  44    }//rand
  45    void srand(int x) {
  46       return;
  47    }
  48    String fgets( ) {
  49       String buf=null;
  50       try{
  51          buf = cin.readLine( );
  52       }catch(Exception e){;}
  53       return buf;
  54    }//fgets
  55 }//calss c2java 
