类的开始
来源:互联网 发布:招商银行待遇知乎 编辑:程序博客网 时间:2024/06/14 06:33
#include <iostream>
using namespace std;
class Ellipse
{
int a,b,x,y;
float area;
public:
void set_Ellipse(int ,int ,int ,int);
void fuc_area();
};
void Ellipse::set_Ellipse(int a1,int b1,int x1,int y1)
{
a=a1;
b=b1;
x=x1;
y=y1;
}
void Ellipse::fuc_area()
{ area=3.14*(x-a)*(b-y);
cout<<"你所要求的椭圆的面积为:"<<area<<endl;
}
int main()
{
Ellipse Ellipse1;
int a2,b2,x2,y2;
cout<<"请输入椭圆的左上角和右下角的坐标:"<<endl;
cin>>a2>>b2>>x2>>y2;
Ellipse1.set_Ellipse(a2,b2,x2,y2);
Ellipse1.fuc_area();
return 0;
}
using namespace std;
class Ellipse
{
int a,b,x,y;
float area;
public:
void set_Ellipse(int ,int ,int ,int);
void fuc_area();
};
void Ellipse::set_Ellipse(int a1,int b1,int x1,int y1)
{
a=a1;
b=b1;
x=x1;
y=y1;
}
void Ellipse::fuc_area()
{ area=3.14*(x-a)*(b-y);
cout<<"你所要求的椭圆的面积为:"<<area<<endl;
}
int main()
{
Ellipse Ellipse1;
int a2,b2,x2,y2;
cout<<"请输入椭圆的左上角和右下角的坐标:"<<endl;
cin>>a2>>b2>>x2>>y2;
Ellipse1.set_Ellipse(a2,b2,x2,y2);
Ellipse1.fuc_area();
return 0;
}
- 类的开始
- 开始的开始
- 开始的开始
- 开始的开始
- 不是开始的开始
- 开始!新的开始?
- 开始新的开始
- 开始的开始
- 开始的开始
- 开始的开始
- 开始的开始。。
- 开始的开始
- 开始的开始
- 开始的开始
- 开始的开始
- 开始的开始
- 开始的开始
- 开始的开始
- 关于GCC的理解——On the understanding of the GCC
- 基于virtio在虚拟机与主机之间传递消息
- 学习笔记之有关杀毒软件对软件运行的影响
- 初探js特效魅力之无缝滚动
- oracle sql 执行计划分析(一)
- 类的开始
- HDU 4614(线段树)
- pc^2 比赛 H Bounce by Hyoga
- 羊群效应
- poj - 1002 - 487-3279(基数排序)
- 程序员的爱情故事
- Bloom Filter 原理与应用
- C程序语言中的宏定义
- 浅析libvirt的nwfilter功能