三角形の三辺

918 ワード

/*
*Copyright (c) 2016,         
*All rights reserved.
*    :main.cpp
*      :  
*    :2016 3 30 
*     :v1.0
*
*    :        。
*    :
*    :        。
*/
#include<iostream>
using namespace std;
class Triangle
{
public:
	Triangle(double x=1,double y=1,double z=1);
	void shouMessage();
private:
	double a,b,c;
};

void Triangle::shouMessage()
{
   cout<<"       :"<<a<<'\t'<<b<<'\t'<<c<<endl;


}
Triangle::Triangle(double x,double y,double z)
{
     a=x;
	 b=y;
	 c=z;
  
}
int main()
{
  Triangle tri1;
  tri1.shouMessage();
  Triangle tri2(1.5);
  tri2.shouMessage();
  Triangle tri3(1.5,1.5);
  tri3.shouMessage();
  Triangle tri4(7,8,9);
  tri4.shouMessage();

  return 0;
  
}
<img src="http://img.blog.csdn.net/20160405221328491" alt="" />