MorfiN | 28 Nisan 2012 10:33 | Kordinat sistemi uzaklık hesaplama PHP- Kodu: #include<iostream>
#include<fstream>
#include<math.h>
using namespace std;
class uzunluk{
private:
int x,y;
float sonuc;
public:
void degerAl(){
int x1,y1;
cout<<"x y degerlerini giriniz=";cin>>x1>>y1;
x = x1 ; y = y1;
}
void hesapla(){
int a,b;
float sonuc1;
sonuc1=sqrt((float) a*a + b*b );
sonuc=sonuc1;
}
void yaz(){
cout<<"sonuc="<<sonuc<<endl;
}
};
int main()
{
uzunluk hesap;
hesap.degerAl();
hesap.hesapla();
hesap.yaz();
system("pause");
return 0;
}
|