-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.java
38 lines (29 loc) · 1006 Bytes
/
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
package io.github.tahanima.uva._1124;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
/**
* @param equations denotes a string arraylist containing equations
* @return a string arraylist containing the answers
*/
public static ArrayList<String> solve(ArrayList<String> equations) {
// Implement this method
return new ArrayList<>();
}
/**
* Takes care of the problem's input and output.
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
StringBuilder stringBuilder = new StringBuilder();
ArrayList<String> equations = new ArrayList<>();
while (scanner.hasNextLine()) {
equations.add(scanner.nextLine());
}
ArrayList<String> answers = solve(equations);
for (String answer: answers) {
stringBuilder.append(String.format("%s%n", answer));
}
System.out.print(stringBuilder);
}
}