Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cmath>
- using namespace std;
- int main()
- {
- ifstream plik ("trojkaty.txt");
- double x1,y1,x2,y2,x3,y3;
- while (!plik.eof())
- {
- plik>>x1>>y1>>x2>>y2>>x3>>y3;
- cout<<"Odleglosc miedzy punktami A = ("<<x1<<", "<<x2<<"), B = ("<<x2<<", "<<y2<<") wynosi: "
- <<sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement