⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 6_53.cpp

📁 C++程序设计技能百练随书配套光盘的源码
💻 CPP
字号:
 #include<iostream.h>
const double pi=3.1415926;
struct Column
{
	double radius;
	double height;
}myc;

void SetColumn()
{
	double r,h;
	cout<<"Input the radius and height of a column!";
	cout<<endl;
	cout<<"radius=";
	cin>>r;
	cout<<"height=";
	cin>>h;
	myc.radius=r;
	myc.height=h;
}
double getvolume()
{
	return pi*myc.radius*myc.radius*myc.height;
}
double getsurface()
{
	return 2*pi*myc.radius*(myc.height+myc.radius);
}
void disp()
{
	cout<<"The volume of the column is "<<getvolume();
	cout<<endl;
	cout<<"The surface of the column is "<<getsurface();
	cout<<endl;
}

void main()
{
	SetColumn();
	getvolume();
	getsurface();
	disp();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -