Advertisement
krasio12356

Mining rig

Apr 16th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5.                                                      // Mining rig
  6. int main()
  7. {
  8.     double card, thing, current, win;
  9.     cin >> card >> thing >> current >> win;
  10.     double sum = card * 13 + thing * 13 + 1000;
  11.     double perday = (win - current) * 13;
  12.     double payback = ceil(sum / perday);
  13.     printf("%.0f\n", sum);
  14.     printf("%.0f\n", payback);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement