KIT_JAVA AND PYTHON_B7 CASE PROBLEM 2 CASE PROBLEM 2

Run Settings
LanguageJava
Language Version
Run Command
import java.util.Calendar; import java.util.Scanner; import static java.lang.System.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(in); int d1 = scan.nextInt(); int m1 = scan.nextInt(); int y1 = scan.nextInt(); int d2 = scan.nextInt(); int m2 = scan.nextInt(); int y2 = scan.nextInt(); out.println(libraryFine(d1, m1, y1, d2, m2, y2)); } public static int libraryFine(int d1, int m1, int y1, int d2, int m2, int y2) { Calendar response = Calendar.getInstance(); Calendar deadline = Calendar.getInstance(); response.set(y1, m1, d1); deadline.set(y2, m2, d2); if (0 >= response.compareTo(deadline)) { return 0; } if (y1 == y2) { if (m1 == m2) { return Math.abs(d2 - d1) * 15; } return Math.abs(m2 - m1) * 500; } else { return 10000; } } }
Editor Settings
Theme
Key bindings
Full width
Lines