风剑附魔什么好看:#include<iostream.h>

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/03 17:30:25
#include<iostream.h>

class SerApp
{
protect:
float imprest;
void warning()
{
cout<<"BEEP!if you is the people on my own side,you can see this news!"<<endl;
}

public:
void accept()
{
cout<<"\nEnter your imprest ,please :\t"<<endl;
cin>>impress;
cout<<"\nYour impress is :\t"<<impress;
}

void display()
{
cout<<"\nNow ,your impress:\t"<<impress;
}
};

//声明SerApp的子类

class sonSerApp:SerApp
{
public:
void sondisplay()
{
cout<<"\n the display of extends class is:"<<endl;
warning();
}
};

int main()
{
SerApp c;
c.accept();
c.display();

sonSerApp sonc;
sonc.sondisplay();
return 0;
}