tei123

to co nizej tylko moje

May 8th, 2018
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. class Trojkat
  7. {
  8. private:
  9. float x;
  10. float y;
  11. float z;
  12. float obw2;
  13. public:
  14. float pole;
  15.  
  16. Trojkat(float x, float y, float z) {
  17. this->x = x;
  18. this->y = y;
  19. this->z = z;
  20. }
  21.  
  22. Trojkat()
  23. {
  24. x=0;
  25. y=0;
  26. z=0;
  27. };
  28.  
  29. Trojkat(const Trojkat &trojkat)
  30. {
  31. x=trojkat.x;
  32. y=trojkat.y;
  33. z=trojkat.z;
  34. };
  35.  
  36. static bool SprawdzXYZ(float x, float y, float z)
  37. {
  38. if(((x&&y&&z>0)&&(x+y>z)&&(z+x>y)&&(z+y>x)))
  39. return true;
  40. else return false;
  41. };
  42. };
  43.  
  44. int main()
  45. {
  46. Trojkat *pierwszy = new Trojkat(5,7,9);
  47. Trojkat drugi (*pierwszy);
  48. cout << Trojkat::SprawdzXYZ(3,6,8);
  49.  
  50.  
  51.  
  52. getch();
  53. return 0;
  54. }
Add Comment
Please, Sign In to add comment