Google Code Jam – Template Java by vudduu

vudduu: No utilizo Java todo el tiempo, pero cuando lo hago utilizo el siguiente template.

import java.math.*;
import java.util.*;
import java.io.*;

public class D {

	void solve() throws IOException{
		int t = nextInt(), m;
		for(int i = 0; i < t; i++) {
			m = nextInt();
			int res = 0;

			System.out.println("Case #" + (i+1) + ": " + res);
		}
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

    void run() throws IOException {
		//in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		in = new BufferedReader(new FileReader("D.in"));
		//out.println("output.txt");
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new D().run();
	}

	BufferedReader in;
	StringTokenizer str;
	PrintWriter out;

	String next() throws IOException {
		while ((str == null) || (!str.hasMoreTokens())) {
			str = new StringTokenizer(in.readLine());
		}
		return str.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

}

 

Anuncios