solved dealem out, not weight diff
This commit is contained in:
35
solutions/battle-of-the-brains-2026/DealEmOut.java
Normal file
35
solutions/battle-of-the-brains-2026/DealEmOut.java
Normal file
@@ -0,0 +1,35 @@
|
||||
// General imports
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class DealEmOut {
|
||||
public static void main(String[] args) {
|
||||
Scanner sc = new Scanner(System.in);
|
||||
|
||||
// Write code here
|
||||
|
||||
int a = sc.nextInt();
|
||||
int b = sc.nextInt();
|
||||
int c = sc.nextInt();
|
||||
|
||||
int cards = 0;
|
||||
int value = a + b + c;
|
||||
|
||||
if (a == 0)
|
||||
cards++;
|
||||
if (b == 0)
|
||||
cards++;
|
||||
if (c == 0)
|
||||
cards++;
|
||||
|
||||
int known = 3 - cards;
|
||||
|
||||
double adder = (416.0 - value) / (52.0 - known);
|
||||
|
||||
double returner = value + adder * cards;
|
||||
|
||||
System.out.printf("%.2f", returner);
|
||||
|
||||
sc.close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user