问题 解答题

某公司大厅里有6根长方体立柱,每根立柱长1.8米,宽1.5米,高5.4米.

(1)这6根立柱一共占地面积是多少平方米?

(2)这6根立柱所占的空间有多大?

(3)在每根立柱的四周刷油漆,这6根立柱刷油漆的面积至少是多少平方米?

答案

(1)1.8×1.5×6,

=2.7×6,

=16.2(平方米);

答:这6根立柱一共占地面积是16.2平方米.

(2)1.8×1.5×5.4×6,

=14.58×6,

=87.48(立方米);

答:这6根立柱所占的空间是87.48立方米.

(3)(1.8×5.4+1.5×5.4)×2×6,

=(9.72+8.1)×12,

=17.82×12,

=213.84(平方米);

答:这6根立柱刷油漆的面积至少是213.84平方米.

单项选择题
问答题

【说明】
以下【C++程序】实现一个简单的小型复数类MiniComplex,该复数类能进行输入、输出、复数的加法、减法、乘法和除法运算,还可以进行复数的相等比较。
【C++程序】
#ifndef H_MiniComplex
#define H_MiniComplex
#include <iostream>
using namespace std;
class MiniComplex
public: //重载流插入和提取运算符
(1) ostream&operator<<(ostream &osObject,const MiniComplex&complex)
osObject<<"("<<complex.realPart<<"+"<<complex.imagPart<<"i"<<")";
return osObject;

(2) istream&operator>>(istream&isObject, MiniComplex&complex)
char ch;
isObject >>complex.realPart>>ch>>complex.imagPart>>ch;
return isObject;

MiniComplex(double real=0,double imag=0); //构造函数
MiniComplex operator+(const MiniComplex&otherComplex)const; //重载运算符+
MiniComplex operator-(const MiniComplex&otherComplex)const; //重载运算符-
MiniComplex operator*(const MiniComplex&otherComplex)const; //重载运算符*
MiniComplex operator/(const MiniComplex&otherComplex)const; //重载运算符/
bool operator==(const MiniComplex&otherComplex)const; //重载运算符==
private :
double (3) ;
double imagPart;
;
#end if
#include "MiniComplex.h"
bool MiniComplex::operator==(const MiniComplex&otherComplex)const
return(realPart==otherComplex.realPart&&imagPart==ortherComplex.imagPart);MiniComplex::MiniComplex(double real,double imag)
realPart== real;imagPart==imagPart;MiniComplex MiniComplex::operator+(const MiniComplex&otherComplex)const
MiniComplex temp;
temp.realPart = realPart+ortherComplex. realPart;
temp.imagPart = imagPart +ortherComplex. imagPart;
return temp; (4)
MiniComplex temp;
temp.realPart= realPart-ortherComplex. realPart;
temp.imagPart = imagPart-ortherComplex. imagPart;
return temp;MiniComplex MiniComplex::operator*(const MiniComplex&otherComplex)const
MiniComplex temp;
temp.realPart = (realPart*ortherComplex. realPart)-(imagPart *ortherComplex.imagPart);
temp.imagPart = (realPart*ortherComplex. imagPart)+(imagPart *ortherComplex.realPart);
return temp;MiniComplex MiniComplex::operator/(const MiniComplex&otherComplex)const
MiniComplex temp;
float tt;
tt=1/(ortherComplex.realPart*ortherComplex.realPart+ortherComplex.imagPart *ortherComplex. imagPart);
temp.realPart=((realPart*ortherComplex, realPart)+(imagPart *ortherComplex. imagPart))*tt;
temp.imagPart =((imagPart *ortherComplex. realPart)-(realPart*ortherComplex. imagPart))*tt;
return temp;#include <iostream>
#include <MiniComplex.h>
using namespace std;
int main()
MiniComplex numl(23, 34),num2(56, 35);
cout<<"Initial Value of num1="<<num1<<"\n Initial Value of num2="<<num2<<end1;
cout<<num1<<"+"<<num2<<"="<<num1+num2<<end1; //使用重载的加号运算符
cout<<num1<<"-"<<num2<<"="<<num1-num2<<end1; //使用重载的减号运算符
cout<<num1<<"*"<<num2<<"="<<num1*num2<<end1; //使用重载的乘号运算符
cout<<num1<<"/"<<num2<<"="<<num1/num2<<end1; //使用重载的除号运算符
(5) ;