UVA – 10071 – Back to High School Physics

  • ID : UVA – 10071 – Back to High School Physics
  • Submissions :
    • Java – Accepted
  • Difficulty : Shame to Solve
  • Type : Adhoc
  • Time for Submission : 10 minutes
  • Solution Description :
    • Output the multiplication of the v & t and multiply them by 2.
  • Problems :
    • don’t forget to multiply by 2
  • Code :


import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		ArrayList<Integer> sol = new ArrayList<Integer>();
		while(in.hasNext()){
			int v=in.nextInt(),t=in.nextInt();
			sol.add(v*t*2);
		}
		for(int s : sol)
			System.out.println(s);
	}
}

Advertisements

One thought on “UVA – 10071 – Back to High School Physics

  1. Md Erfan says:

    how work the last 2 line and use of this line detail of this program.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: