We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
importjava.io.*;importjava.util.*;publicclassSolution{publicstaticvoidmain(String[]args){/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */Scannersc=newScanner(System.in);intd1=sc.nextInt();intm1=sc.nextInt();inty1=sc.nextInt();intd2=sc.nextInt();intm2=sc.nextInt();inty2=sc.nextInt();intfine=0;if(y1>y2){fine=10000;}elseif(y1==y2&&m1>m2){fine=500*(m1-m2);}elseif(y1==y2&&m1==m2&&d1>d2){fine=15*(d1-d2);}System.out.println(fine);}}
Cookie support is required to access HackerRank
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 8 : All test cases passed.