Assalaikum my friend.....How are you...i hope you fine like me...
long is not a blog post. understand, many new tasks. Yes, although this blog post also includes the task.
well, now I'll post the program calculates the distance in a graph.
we just see the program !!!
#include <cstdlib>
#include <iostream.h>
#include <string.h>
using namespace std;
int main(int argc, char *argv[])
{
char kata1; //variabel
char kata2; //variabel
char kata3; //variabel
int a, b, c; // tdata type
cout<<"||====================================================||"<<endl;
cout<<"|| Program Menghitung Jarak pada Graf ||"<<endl;
cout<<"||====================================================||"<<endl;
cout<<endl;
cout<<"Masukkan jarak antara titik simpul "<<kata1<<" dengan "<<kata3<<" : ";cin>>a;
cout<<"Masukkan jarak antara titik simpul "<<kata3<<" dengan "<<kata2<<" : ";cin>>b;
cout<<"Masukkan jarak antara titik simpul "<<kata2<<" dengan "<<kata1<<" : ";cin>>c;
cout<<endl<<endl;
cout<<"Jadi panjang jarak pada graf totalnya = "<<a+b+c<<endl<<endl; // formula to calculate the triangle graph
system("color 57"); //gives color to the results of running
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream.h>
#include <string.h>
using namespace std;
int main(int argc, char *argv[])
{
char kata1; //variabel
char kata2; //variabel
char kata3; //variabel
int a, b, c; // tdata type
cout<<"||====================================================||"<<endl;
cout<<"|| Program Menghitung Jarak pada Graf ||"<<endl;
cout<<"||====================================================||"<<endl;
cout<<endl;
cout<<"Masukkan jarak antara titik simpul "<<kata1<<" dengan "<<kata3<<" : ";cin>>a;
cout<<"Masukkan jarak antara titik simpul "<<kata3<<" dengan "<<kata2<<" : ";cin>>b;
cout<<"Masukkan jarak antara titik simpul "<<kata2<<" dengan "<<kata1<<" : ";cin>>c;
cout<<endl<<endl;
cout<<"Jadi panjang jarak pada graf totalnya = "<<a+b+c<<endl<<endl; // formula to calculate the triangle graph
system("color 57"); //gives color to the results of running
system("PAUSE");
return EXIT_SUCCESS;
}
explanation :
This program is made in Dev C++. Purpose of the program above is, calculate the distance on the graph, which suppose an image triangle A, B, C as below
The program may calculate the distance from A to B, B to C and B to C.