vakho

კოლოქვიუმისთვის – ამოცანა 6

May 4th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class className
  6. {
  7. private:
  8.     int realNum;
  9. public:
  10.     className(){ realNum = 0; };
  11.     className(int num):realNum(num){ };
  12.     ~className(){};
  13.     int countFifthExponent(){ return (realNum * realNum * realNum * realNum * realNum); };
  14.     friend int countDouble(className &a){ return a.realNum * 2; };
  15. };
  16.  
  17. int main()
  18. {
  19.     className objA;
  20.     className objB(14);
  21.     cout << objA.countFifthExponent() << endl << countDouble(objB) << endl;
  22.     system("PAUSE");
  23.     return (0);
  24. };
Advertisement
Add Comment
Please, Sign In to add comment