环境搭建: visual studio code 软件下载安装 下载对应的C++,runner code等插件
基础代码 #include using namespace std; class Box{ public: int getArea(); double length; double width; double height; int a; double b; float c; void print(int data){ cout<<“int”<<data<<endl; } void print(double data){ cout<<“doubel”<<data<<endl; } void print(float data){ cout<<“fudian” <<data<<endl; }
void setlength(double len){ length=len; } void setwidth(double wid){ width=wid; } void setheight(double heig){ height=heig; }}; class React:public Box{ public: int getarae(){ return widthheightlength; } }; class Triangle:public Box{ public: int getArea(){ return widthheight; } }; int main(){ cout << “Content-type:text/html\r\n\r\n”; cout << “\n”; cout << “\n”; cout << “Hello World - 第一个 CGI 程序\n”; cout << “\n”; cout << “\n”; cout << “
