-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbegin35.java
More file actions
37 lines (22 loc) · 605 Bytes
/
begin35.java
File metadata and controls
37 lines (22 loc) · 605 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package begin;
import java.util.Scanner;
public class begin35 {
public static void main(String[] args) {
float v;
float u;
float t1;
float t2;
float s;
Scanner scanner=new Scanner(System.in);
System.out.print("V:");
v = scanner.nextFloat();
System.out.print("U:");
u = scanner.nextFloat();
System.out.print("T1:");
t1 = scanner.nextFloat();
System.out.print("T2:");
t2 = scanner.nextFloat();
s = v * t1 + (v - u) * t2;
System.out.printf("S:%f\n",s);
}
}