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 26
|
#include <iostream>
#include <conio.h>
#include <string>
#include <vector>
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};
std::vector<std::string> v;
//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++){
v.push_back(Huruf[i]+"-"+Huruf[j]);
}
}
for (int ii=0; ii<10; ii++){
cout<<v[ii]<<"="<<arr[ii]<<" ";
}
}
| |