Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <iomanip> // для setprecision
- #include <string>
- #include <Windows.h>
- using namespace std;
- class Points //класс точки
- {
- public:
- int x1, x2, y1, y2;//поля координат
- {
- public:
- Look(); // конструктор
- {
- cout << "Введите координату x1: ";
- cin << x1;
- cout << "Введите координату x2: ";
- cin << x2;
- cout << "Введите координату y1: ";
- cin << y1 ;
- cout << "Введите координату y2: ";
- cin << y2;
- }
- }
- void Print()
- {
- cout << "x1 : " << x1 << endl;
- cout << "x2 : " << x2 << endl;
- cout << "y1 : " << y1 << endl;
- cout << "y1 : " << y2 << endl;
- }
- ~Look();
- class Cut :public Points;
- {
- constr();
- public:
- {
- float d();
- {
- sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1 - y2))
- }
- }
- class Vektor :public Points;
- {
- int z1, z2;
- public:
- Vektor()
- {
- cout << "Введите координату z1: ";
- cin << z1;
- cout << "Введите координату z2: ";
- cin << z2;
- }
- void Print_Vektor()
- {
- cout << "Координаты вектора в пространстве: (" << x1 << x2 << y1 << y2 << z1 << z2 << ")" << endl;
- }
- void Krd_Vektor()
- {
- cout << x2 - x1 << " " << y2 - y1 << " " << z2 - z1;
- }
- int main()
- {
- setlocale(LC_ALL, "rus");
- Points points;
- cout << "Координаты точек: ";
- points.Look;
- cout << "Отрезок: ";
- Cut сut;
- cout << " Длина Отрезка: ";
- cut.d();
- Vektor vektor;
- cout << " Координаты концов векторов: ";
- vektor.Print_Vektor();
- cout << " Координаты векторов: ";
- vektor.Krd_Vektor();
- system("pause");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement