You are viewing a single comment's thread. Return to all comments →
C++ 14 solution by me,
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT / int dda, mma, yya; int dde, mme, yye; cin>>dda>>mma>>yya; cin>>dde>>mme>>yye; int fine; if(yya> yye) { fine= 10000; } else if(mma> mme && yya>= yye) { fine= 500(mma-mme); } else if(dda> dde && (mma>= mme) && (yya>= yye)) { fine= 15*(dda-dde); } else { fine= 0; } cout<
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 →
C++ 14 solution by me,
include
include
include
include
include
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT /
int dda, mma, yya; int dde, mme, yye; cin>>dda>>mma>>yya; cin>>dde>>mme>>yye; int fine; if(yya> yye) { fine= 10000; } else if(mma> mme && yya>= yye) { fine= 500(mma-mme); } else if(dda> dde && (mma>= mme) && (yya>= yye)) { fine= 15*(dda-dde); } else { fine= 0; } cout<