We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b88e836 commit 9e54facCopy full SHA for 9e54fac
Easy-Level/TrickOrTreat.java
@@ -0,0 +1,19 @@
1
+import java.io.*;
2
+public class Main {
3
+ public static void main (String[] args) throws IOException {
4
+ File file = new File(args[0]);
5
+ BufferedReader br = new BufferedReader(new FileReader(file));
6
+ String line;
7
+ while ((line = br.readLine()) != null) {
8
+ String a = line.replaceAll("\\D+"," ").trim();
9
+ String[] b = a.split(" ");
10
+ int v = Integer.parseInt(b[0]);
11
+ int z = Integer.parseInt(b[1]);
12
+ int w = Integer.parseInt(b[2]);
13
+ int h = Integer.parseInt(b[3]);
14
+ int c = (3*v + 4*z + 5*w)*h;
15
+ System.out.println(Math.floorDiv(c, (z+v+w)));
16
+ }
17
+ br.close();
18
19
+}
0 commit comments