-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbegin37.java
More file actions
34 lines (20 loc) · 584 Bytes
/
begin37.java
File metadata and controls
34 lines (20 loc) · 584 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
package begin;
import java.util.Scanner;
public class begin37 {
public static void main(String[] args) {
float v1;
float v2;
float s;
float t;
Scanner scanner=new Scanner(System.in);
System.out.print("v1:");
v1 = scanner.nextFloat();
System.out.print("V2:");
v2 = scanner.nextFloat();
System.out.print("S:");
s = scanner.nextFloat();
System.out.print("T:");
t = scanner.nextFloat();
System.out.printf("S:%f\n",Math.abs(s - (v1 * t + v2 * t)));
}
}