-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.java
46 lines (38 loc) · 1.15 KB
/
Main.java
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
38
39
40
41
42
43
44
45
46
package io.github.tahanima.beecrowd._1010;
import java.util.Scanner;
/**
* @author tahanima
*/
public class Main {
/**
* @param p1 denotes the first product
* @param p2 denotes the second product
* @return a string containing the answer
*/
public static String solve(Product p1, Product p2) {
// Implement this method
return "";
}
/**
* Keeps product information: code, number of units and unit price.
*/
public static class Product {
int code;
int numberOfUnits;
double unitPrice;
public Product(int code, int numberOfUnits, double unitPrice) {
this.code = code;
this.numberOfUnits = numberOfUnits;
this.unitPrice = unitPrice;
}
}
/**
* Takes care of the problem's input and output.
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(solve(
new Product(scanner.nextInt(), scanner.nextInt(), scanner.nextDouble()),
new Product(scanner.nextInt(), scanner.nextInt(), scanner.nextDouble())));
}
}