Untitled

 avatar
unknown
plain_text
3 years ago
542 B
20
Indexable
#include <stdio.h>
#include <math.h>
#include <iostream>

using namespace std;

int oblicz_odleglosc(int x1, int x2, int y1, int y2)
{
	int d;
	d = sqrt(pow(x2 - x1, 2.0) + pow(y2 - y1, 2.0));
	return d;
}
int main()
{
	int x1, x2, y1, y2;
	cout << "Podaj wspolrzedne punktow: \n";
	cout << "Podaj x1:";
		cin >> x1;
		cout << "Podaj y1:";
		cin >> y1;
		cout << "Podaj x2:";
		cin >> x2;
		cout << "Podaj y2:";
		cin >> y2;
		cout << "Odleglosc miedzy punktami wynosi: \n" << oblicz_odleglosc;
		return 0;
}



Editor is loading...