Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <math.h>
- #include <algorithm>
- #include <vector>
- #include <set>
- #include <map>
- #include <sstream>
- #include <queue>
- #include <stdint.h>
- using namespace std;
- int main()
- {
- double fightmoney, sevmoney, plusmpney, year, procent, dtp, undtp, del;
- cin >> fightmoney;
- cin >> sevmoney >> plusmpney;
- cin >> year >> procent;
- cout.setf(ios::fixed);
- cout.precision(6);
- dtp = ((((2 * (sevmoney + plusmpney) + (year - 1)*plusmpney)) / 2.0)*year)*(1 + procent / 100.0);
- undtp = (((2 * (sevmoney+ plusmpney) + (year-1)*plusmpney)) / 2.0)*year+fightmoney;
- del = abs(dtp - undtp);
- if (dtp>undtp&&del>0.000001)
- {
- cout << "Cash" << endl;
- cout << del;
- }
- else
- {
- cout << "Insurance" << endl;
- cout << del;
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment