Advertisement
Spocoman

07. House Painting

Sep 1st, 2023 (edited)
659
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double x, y, h;
  7.     cin >> x >> y >> h;
  8.  
  9.     double green = x * y * 2 - (1.5 * 1.5 * 2) + x * x * 2 - 1.2 * 2;
  10.     double red = 2 * x * y + 2 * x * h / 2;
  11.    
  12.     cout.setf(ios::fixed);
  13.     cout.precision(2);
  14.  
  15.     cout << green / 3.4 << endl;
  16.     cout << red / 4.3 << endl;
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement