28 Nisan 2012, 10:33
#1 Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
Kordinat sistemi uzaklık hesaplama
PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
#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 ;
}
__________________ Kullanıcı imzalarındaki bağlantı ve resimleri görebilmek için en az 20 mesaja sahip olmanız gerekir ya da üye girişi yapmanız gerekir.