#include<iostream>
#include<cmath>
using namespace std;
class Circle{
public:
void radius(double x);
double areas();
private:
double r;
};
void Circle::radius(double x)
{r=x;}
double Circle::areas()
{
return (3.14*r*r);
}
int main()
{Circle cir;
cir.radius(12.5);
double s=cir.areas();
cout<<"s="<<s<<endl;
return 0;
}
3.22
最新推荐文章于 2021-02-27 15:48:12 发布