HaDuyAnh Bai1

Màu nền
Font chữ
Font size
Chiều cao dòng

#include <iostream.h>

#include <stdio.h>

#include <conio.h>

#include <string.h>

class DKXM

{

long so,sokhung,somay;

char chuxe[20],hktt[20];

public:

void nhap();

void xuat();

};

//------------------

void DKXM::nhap()

{

cout<<"Nhap so:";

cin>>so;

cout<<"Nhap chu xe: ";

gets(chuxe);

fflush(stdin);

cout<<" Nhap hktt: ";

gets(hktt);

fflush(stdin);

cout<<" Nhap so khung xe: ";

cin>>sokhung;

cout<<"Nhap so may: ";

cin>>somay;

}

//-------------------

void DKXM::xuat()

{

cout<<so<<"\t"<<chuxe<<"\t"<<hktt<<"\t"<<sokhung<<"\t"<<somay<<endl;

}

//--------------------

void main()

{

clrscr();

DKXM mom;

mom.nhap();

cout<<"so"<<"\t"<<"chu xe"<<"\t"<<"ho khau thuong tru"<<"\t"<<"so khung"<<"\t"<<"so may"<<endl;

mom.xuat();

getch();

}

Bạn đang đọc truyện trên: Truyen2U.Pro

#bai1#hda