第五周 三角形类 3

/*
 *copyright(c) 2014,烟台大学计算机学院
 *All rights reserved
 *文件名称:test.cpp
 *作者:谭泽纯
 *版本:v6.0
 *
 *问题描述:三角型类

 *输入描述:无
 *程序输出:三角型类

*/

 

 

 

 


#include<iostream>
using namespace std;
class Triangle
{
public:
 Triangle(int xx,int yy,int zz)
 {
  x=xx;
  y=yy;
  z=zz;
 }
 void showMessage()
 {
  cout<<x<<" "<<y<<" "<<z<<endl;
 }
private:
 int x,y,z;
};

int main()
{
 Triangle Tri(7,8,9);
 Tri.showMessage();
}

 

你可能感兴趣的:(第五周 三角形类 3)