Advertisement
Guest User

Cpp programm

a guest
Sep 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. class lul{
  5. private:
  6.     int a;
  7. public:
  8.         void init();
  9.         void seta(int,int);
  10.         int geta();
  11. };
  12.  
  13.     void lul::init(){
  14.     a=0;
  15. }
  16.  
  17.  
  18.     void lul::seta(int d, int f){
  19.     a=pow(d,f);
  20.     }
  21.  
  22.     int lul::geta(){
  23.         return a;
  24.     }
  25.  
  26. using namespace std;
  27.  
  28. int main()
  29. {
  30.     lul xd;
  31.     int f1, f2;
  32.     cout << "Введіть значення, яке буде відноситись до степеня : ";
  33.     cin >> f1;
  34.     cout << "Введіть значення, до якого буде підноситись число :  ";
  35.     cin >> f2;
  36.             xd.init();
  37.             xd.seta(f1, f2);
  38.     cout << "Значення а = " << xd.geta() << endl;
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement