#include<iostream>
using namespace std;
class cylinder{
private:
double r;
double h;
double V;
public:
void vol_input()
{
cout<<"please input the r:";
cin>>r;
cout<<"please input the h:";
cin>>h;
}
void vol_out()
{
V=3.14 * r*r*h;
cout<<"the volume is:"<<V<<endl;
cout<<"********************"<<endl;
}
}cylinder[100];
int main()
{
int i;
for(i=0;i<100;i++)
{
cylinder[i].vol_input();
cylinder[i].vol_out();
}
return 0;
}
3.23
最新推荐文章于 2024-03-25 19:50:03 发布