Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. inline void f1(){cout<<"f1"<<endl;}
  4. inline void f2(){cout<<"f2"<<endl;}
  5. inline void f3(){for(int i=0;i<5;i++){cout<<"f3("<<i<<")"<<endl;}}
  6. inline void f4(){for(int i=4;i>=0;i--){cout<<"f4("<<i<<")"<<endl;}}
  7.  
  8. class a{
  9.     int a1;
  10.     int a2;
  11. public:
  12.     virtual void dsmth()=0;
  13. };
  14.  
  15. class b:public a{
  16.     int b1;
  17. public:
  18.     void dsmth(){cout<<"dsmth(b)"<<endl;}
  19. };
  20.  
  21. class c:public a{
  22.     int c1;
  23. public:
  24.     void dsmth(){cout<<"dsmth(c)"<<endl;}
  25. };
  26.  
  27. int main(){
  28.     int a=5;
  29.     double qb=static_cast<double>(a)/3;
  30.     cout<<"qb = "<<qb<<endl;
  31.     b ob;
  32.     ob.dsmth();
  33.     c ob1;
  34.     ob1.dsmth();
  35.     f1();
  36.     f2();
  37.     f3();
  38.     f4();
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement