thisz指针联系
来源:互联网 发布:上海财经大学知乎 编辑:程序博客网 时间:2024/05/02 01:36
#include <iostream>
#include"cmath"
using namespace std;
class triangle
{
private:
double a,b,c;
public:
void set(double ia,double ib,double ic)
{
this->a=ia;this->b=ib;this->c=ic;
}
double area();
};
int main()
{
triangle m;
double aa,bb,cc;
cin>>aa>>bb>>cc;
cout<<"三角形面积为:"<<m.area()<<endl;
return 0;
}
inline double triangle::area()
{
double s=(this->a+this->b+this->c)/2;
return sqrt (s*(s-this->a)*(s-this->b)*(s-this->c));
}
#include"cmath"
using namespace std;
class triangle
{
private:
double a,b,c;
public:
void set(double ia,double ib,double ic)
{
this->a=ia;this->b=ib;this->c=ic;
}
double area();
};
int main()
{
triangle m;
double aa,bb,cc;
cin>>aa>>bb>>cc;
cout<<"三角形面积为:"<<m.area()<<endl;
return 0;
}
inline double triangle::area()
{
double s=(this->a+this->b+this->c)/2;
return sqrt (s*(s-this->a)*(s-this->b)*(s-this->c));
}
0 0
- thisz指针联系
- 引用与指针的联系
- 数组和指针的联系
- 指针数组、数组指针联系和区别
- 指针和const的联系---常量指针与指针常量
- 句柄和指针的区别与联系
- 内存与指针实质与联系.doc
- 指针和引用的联系与区别
- 指针和引用的区别于联系
- 指针与引用的区别与联系
- 句柄和指针的区别和联系
- 句柄与指针的联系与区别
- 指针和引用的联系与区别
- 指针和引用的区别和联系
- 引用和指针的联系和区别
- 指针和引用的联系与区别
- 指针和引用的联系与区别
- 指针和引用的联系与区别
- 多线程CyclicBarrier的用法
- Android跨进程通信——AIDL
- 关于AndroidStudio升级到2.0的一些问题汇总
- Monkeyrunner
- 第16周阅读程序(2)
- thisz指针联系
- android项目重构之状态模式
- 命令模式(Command Pattern)
- openwrt时间设置查看
- ESAPI学习笔记
- Windows服务 开机自动运行
- 剑指offer-001
- IOS Dev Intro - UIControlEvent
- 向量中断和非向量中断