Mempron

KP53E199

Nov 24th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. // KP53E199
  2. #include "pch.h"
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int x, y, z, square, volume;
  10.  
  11.     cout << "Enter x, y, z: "; cin >> x >> y >> z;
  12.     if (x <= 0 || y <= 0 || z <= 0) cout << "Data is incorrect." << endl;
  13.     else
  14.     {
  15.         square = 2 * x * y + 2 * x * z + 2 * y * z;
  16.         volume = x * y * z;
  17.  
  18.         cout << "Square = " << square << ", volume = " << volume << endl;
  19.     }
  20.    
  21.     return 0;
  22. }
Add Comment
Please, Sign In to add comment