Dear all java coders,

I was using C++ for coding in such computations and now I try to use Java
and I use the following template please if there any comments about
performance or if any one who have a another one which is more efficient
than mine ?



import java.io.*;
import java.util.Scanner;
/**
 * @author: Ahmed.Medhat
 * @Email:a.medhat...@gmail.com <email%3aa.medhat...@gmail.com>
 * @CodeJam_Handel: Egy.Turing
 */
public class Test {

    /* if test  -->0
     * if small -->1
     * if large -->2
    */
    int testType = 0;

    Scanner sc;
    PrintWriter pw;

    Test()throws Exception{
        init();

        //Write the code here

        pw.flush();
        sc.close();
    }
    void init()throws Exception{
        if(testType==0){
            sc = new Scanner(new FileReader("c-test.in"));
            pw = new PrintWriter(new FileWriter("c-test.out"));
        }
        else if(testType==1){
            sc = new Scanner(new FileReader("c-small.in"));
            pw = new PrintWriter(new FileWriter("c-small.out"));
        }
        else if(testType==2){
            sc = new Scanner(new FileReader("c-large.in"));
            pw = new PrintWriter(new FileWriter("c-large.out"));
        }
    }
    public static void main(String[] args) throws Exception{
        new Test();
        System.exit(0);
    }
}

-- 
Kind Regards,

Ahmed Medhat
Computer Science
Alexandria university
Egypt

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-code@googlegroups.com
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: Test.java
Description: Binary data

Reply via email to