Guest User

Untitled

a guest
Feb 23rd, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <cstdlib>
  4. #include <string>
  5. #include <fstream>
  6. using namespace std;
  7.  
  8. void drzewko(int &a, int &b, int &P)
  9. {
  10.    
  11.     P = a*b*2; 
  12. }
  13.  
  14. int drzewko2(int &a, int &b, int &P)
  15. {
  16.     P = a*b*3;
  17.    
  18.     return P;
  19. }
  20.  
  21. int main()
  22. {
  23.     cout<<"no hej podaj liczbe:  "<<endl;
  24.     int a,b,P=0;
  25.     cin>>a>>b;
  26.     P = a*b;
  27.     cout<<"twe pole to: "<<P<<endl;
  28.     drzewko(a,b,P);
  29.     cout<<"twe 2 * pole teraz to: "<<P<<endl;  
  30.     drzewko2(a,b,P);
  31.     cout<<"twe 3 * pole teraz to: "<<P<<endl;
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment