Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <algorithm>
- using namespace std;
- struct otrezok
- {
- double x1, y1, x2, y2;
- double len;
- //double *ostanovki;
- void length(double x1, double x2, double y1, double y2)
- {
- len = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
- };
- };
- int main ()
- {
- otrezok bus_1;
- cin >> bus_1.x1 >> bus_1.y1;
- cin >> bus_1.x2 >> bus_1.y2;
- cout << bus_1.len << " ";
- bus_1.length(bus_1.x1, bus_1.x2, bus_1.y1, bus_1.y2);
- cout << bus_1.len;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement