4.16
4
4.17
(1,2)
5,6
(6,9)
4.18
class base1
class base2
class level2
class base2
class level1
class toplevel.
精选范本
4.19
#include
table(int p, int q) { i = p; j = q; }
void ascii(void); protected: int i, j; };
void table::ascii() {
int k = 1;
.
精选范本
.
for(; i <= j; i++) {
cout << setw(4) << i << \ \ << (char)i; if((k) == 0) {
cout << \; } k++; }
cout << \; }
class der_table:public table { public:
der_table(int p, int q, char *m):table(p,q) {
c = m; }
void print(); protected: char *c; };
精选范本
.
void der_table::print() {
cout << c <<\; table::ascii(); } int main() {
der_table ob('a', 'z', \); ob.print(); return 0; }
4.20
#include
class area_c1 {
精选范本