-
#include <iostream>
-
using
namespace
std
;
-
#include <conio.h>
-
-
-
class
nguoi
-
{
-
private
:
-
int
chieucao
;
-
int
cannang
;
-
public
:
-
friend
istream
&
operator
>>
(
istream
&
is,nguoi
&
a
)
;
-
}
;
-
istream
&
operator
>>
(
istream
&
is,nguoi
&
a
)
-
{
-
cout
<<
“Nhap chieu cao va can nang :”
;
-
return
cin
>>
a.
chieucao
>>
a.
cannang
;
a.a.
-
}
-
-
class
giaovien
:
public
nguoi
-
{
-
private
:
-
int
luongthang
;
-
public
:
-
friend
istream
&
operator
>>
(
istream
&
is,giaovien
&
a
)
;
-
}
;
-
istream
&
operator
>>
(
istream
&
is,giaovien
&
a
)
-
{
-
cin
>>
(
nguoi
&
)
a
;
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
nguoi
-
cout
<<
“Nhap vao luong thang : “
;
-
return
cin
>>
a.
luongthang
;
a.
-
}
-
-
void
main
(
)
-
{
-
giaovien x
;
-
cin
>>
x
;
-
getch
(
)
;
-
}