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.
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<algorithm>usingnamespacestd;intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */intD,M,Y,d,m,y,fine=0;cin>>D>>M>>Y;cin>>d>>m>>y;if(D>d&&M==m&&y==Y)fine=15*(D-d);elseif(M>m&&y==Y)fine=500*(M-m);elseif(Y>y)fine=10000;cout<<fine;return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Logic
You are viewing a single comment's thread. Return to all comments →
C++ code