1. Reptor Algorithm:
2. Translasi dari algoritma:
2. Translasi dari algoritma:
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
double m;
double a;
double b;
double c;
double d;
double p;
double
q;
double s;
raptor_prompt_variable_zzyz ="masukkan x1 = ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> a;
raptor_prompt_variable_zzyz ="masukkan y1= ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> b;
raptor_prompt_variable_zzyz ="masukkan x2= ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> c;
raptor_prompt_variable_zzyz ="masukkan y2= ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> d;
p
=c-a;
q
=d-b;
m
=sqrt((p*p)+(q*q));
cout << "panjang garis =
"<<m << endl;
s
=m/2;
cout << "titik tengah = "<<s << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
0 comments:
Post a Comment