Pages

Sunday 9 September 2012

UVA - 10071 - Back to High School Physics (Java Solution)


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        while (true) {
            int v = 0;
            try {
                v = s.nextInt();
            } catch (Exception e) {
                break;
            }
            int t = s.nextInt();

            System.out.println(2*v*t);

        }
    }
}

No comments:

Post a Comment