Advertisement
dartwlad

1-3

Feb 26th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. struct distance1{
  5.     int meter;
  6.     int centimeter; };
  7. struct Volume {
  8.     distance1 length;
  9.     distance1 width;
  10.     distance1 height; };
  11.  
  12. int main()
  13. {
  14.     Volume volume;
  15.     cout << "Enter parameters"<< '\n' << "Length: ";
  16.     cin >> volume.length.meter;
  17.     cin >> volume.length.centimeter;
  18.     cout << "Width ";
  19.     cin >> volume.width.meter;
  20.     cin >> volume.width.centimeter;
  21.     cout << "Height ";
  22.     cin >> volume.height.meter;
  23.     cin >> volume.height.centimeter;
  24.     float Volume;
  25.     Volume = (volume.length.meter + volume.length.centimeter) * (volume.width.meter + volume.width.centimeter) * (volume.height.meter + volume.height.centimeter);
  26.     cout <<"Your room volume: "<< Volume;
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement