1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int main()
{
string Huruf[] = {"A", "B", "C", "D", "E"};
int arr[10] = { 10, 25, 30, 40, 30, 25, 40, 10, 15, 15 };
int no[] = {1, 2, 3, 4, 5, 0};
for (int n = 0; no[n];n++){
cout<<"Titik "<<no[n]<<" = "<<Huruf[n]<<endl;
}
//A-B = 10, A-C = 25, A-D = 30, A-E = 40, B-C = 30, B-D = 25, B-E = 40, C-D = 10, D-E = 15, C-E = 15.
cout<<"Sisi-sisinya = ";
for (int i=0; i<5; i++){
for (int j=i+1; j<5; j++){
cout<<Huruf[i]+Huruf[j]<<" ";
}
}
}
| |