You are viewing a single comment's thread. Return to all comments →
java 7 /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in); int actual_day = sc.nextInt(); int actual_month = sc.nextInt(); int actual_year = sc.nextInt(); int expected_day = sc.nextInt(); int expected_month = sc.nextInt(); int expected_year = sc.nextInt(); int fine =0; if(actual_year < expected_year) { fine = 0; } else { if(actual_year >expected_year) { fine = 10000; } else if(actual_month >expected_month) { fine = 500 *(actual_month - expected_month); } else if(actual_day >expected_day) { fine = 15 *(actual_day - expected_day); } } System.out.println(fine); }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 26: Nested Logic
You are viewing a single comment's thread. Return to all comments →
java 7 /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
}