Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1.  
  2. #include "stdafx.h"
  3. #include <iostream>
  4. using namespace std;
  5. class tochka {
  6. protected:
  7. int a1, a2, a3;
  8. public:
  9. tochka() {}
  10. tochka(int x, int y, int z) {
  11. a1 = x;
  12. a2 = y;
  13. a3 = z;
  14. }
  15.  
  16. void show() {
  17. setlocale(LC_ALL, "Russian");
  18. cout << "Координаты: " << endl;
  19. cout << "x= " << a1 << endl << "y= " << a2 << "z= " << a3 << endl;
  20. }
  21. };
  22. class Krug :public tochka {
  23. public:
  24. double S, R, V;
  25. int b1, b2, b3;
  26. int c1, c2, c3;
  27. Krug() :tochka() {}
  28. Krug(int x, int y, int z, int t, int q, int w) :tochka(x, y, z) {
  29. b1 = q;
  30. b2 = t;
  31. b3 = w;
  32. // c1 = m;
  33. // c2 = n;
  34. // c3 = k;
  35.  
  36. }
  37.  
  38.  
  39. double rr() {
  40. R = sqrt((pow(a2 - a1, 2)) + (pow(b2 - b1, 2)));
  41. return R;
  42.  
  43. }
  44. double AA() {
  45. S = 0;
  46. return S;
  47. }
  48. double oo() {
  49. V = sqrt(4 * 3.14 / R; // o = (4/3*3.14*pow(r, 3)); // V = (4 / 3 * 3.14*pow(R, 3))
  50. return V;
  51. }
  52. void objm() {
  53. setlocale(LC_ALL, "Russian");
  54. cout << "Площадь = " << R << endl;
  55. cout << "Радиус круга = " << V << endl;
  56. cout << "Объём круга =" << S << endl;
  57. }
  58. };
  59.  
  60. int main() {
  61. tochka pp;
  62. Krug pi(1, 2, 3, 4, 5, 6);
  63. pi.show();
  64. pi.rr();
  65. pi.AA();
  66. pi.oo();
  67. pi.objm();
  68. system("pause");
  69. return 0;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement