Помощ за задача - Metric Converter 10/100
Здравейте мъчих тази задачка около час и половина и нещо все пропускам, получих 10/100 в Judge. Ще съм благодарен за обяснение къде бълкам. Поздрави! import java.util.Scanner; public class Test2 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double meters = Double.parseDouble(scanner.nextLine()); String distance1 = scanner.nextLine(); String distance2 = scanner.nextLine(); double mm = 1000; double cm = 100; double mi = 0.000621371192; double in = 39.3700787; double km = 0.001; double ft = 3.2808399; double yd = 1.0936133; double result = 0; if (distance1.equals("mm")) { result = meters/mm; } else if (distance1.equals("cm")) { result = meters/cm; } else if (distance1.equals("mi")) { result = meters/mi; } else if (distance1.equals("in")) { result = meters/in; } else if (distance1.equals("km")) { result = meters/km; } else if (distance1.equals("ft")) { result = meters/ ft; } else if (distance1.equals("yd")) { result = meters / yd; if (distance2.equals("mm")) { result = meters*mm; } else if (distance2.equals("cm")) { result = result*cm; } else if (distance2.equals("mi")) { result = result *mi; } else if (distance2.equals("in")) { result = result * in; } else if (distance2.equals("km")) { result = result * km; } else if (distance2.equals("ft")) { result = result * ft; } else if (distance2.equals("yd")) { result = result * yd; } System.out.printf("%.8f &s", result, distance2); } } }