Tải bản đầy đủ (.pdf) (1 trang)

Baitap class diem

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (154.31 KB, 1 trang )

<span class='text_page_counter'>(1)</span><div class='page_container' data-page=1>

//============================================================================
// Name : class_diem.cpp


// Author : Nguyen Huu The
// Version :


// Copyright : Your copyright notice


// Description : class in C++, Eclipse IDE for C/C++, Ansi-style


//============================================================================
<b>#include <stdio.h> </b>


//#include <iostream.h>
<b>#include <iostream> </b>
<b>using namespace std; </b>
<b>class Diem{ </b>


private:
int x, y;
public:


Diem(){ //su dung ham inline
x=1; y=1;


}


int getX(){
return x;
}



};


<b>class DuongTron{ </b>
private:
Diem tam;
int bankinh;
public:


void InHoanhDo(){


cout<<tam.getX(); //in ra x la: 1
}


};


<b>int main() </b>
{


</div>

<!--links-->

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×