-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBeeCrowd1010.java
22 lines (19 loc) · 913 Bytes
/
BeeCrowd1010.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.*;
// Problem URL: https://www.beecrowd.com.br/judge/en/problems/view/1010
// Last access 9 September 2022
// Visit my GitHub repository @ https://github.com/skan90
public class BeeCrowd1010 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String produto1 = input.nextLine();
String produto2 = input.nextLine();
String[] divisaoEmArray1 = produto1.split("\\s+");
String[] divisaoEmArray2 = produto2.split("\\s+");
int quantidade1 = Integer.parseInt(divisaoEmArray1[1]);
int quantidade2 = Integer.parseInt(divisaoEmArray2[1]);
float preco1 = Float.parseFloat(divisaoEmArray1[2]);
float preco2 = Float.parseFloat(divisaoEmArray2[2]);
float valorTotal = (quantidade1 * preco1) + (quantidade2 * preco2);
System.out.printf("VALOR A PAGAR: R$ %.2f\n", valorTotal);
}
}