using namespace std;
int main(){
string a[2];
string b[3];
int c [3];
int d [5];
cout<<"masukan himpunan a (2) : ";
for (int n=0; n<2; n++){
cin >>a[n];
}
cout<<"masukan himpunan b (3) : ";
for (int m=0; m<3; m++){
cin >>b[m];
}
cout<<"hasil penggabungan a dan b : {"<<endl;
for (int i=0; i<2;){
for (int j=0; j<3; j++){
cout<<"(" << a[i] << "," << b[j] << ")";
}
i++;
}
cout<<"}"<<endl;
cout<<"masukan anggota himpunan c (angka) : ";
for (int x=0; x<3; x++){
cin>>c[x];
}
cout<<"masukan anggota himpunan d (angka) : ";
for(int y=0; y<5; y++){
cin>>d[y];
}
cout<<"hasil himpunan c habis membagi d : {";
for (int k=0; k<3;){
for (int l=0; l<5; l++){
if (d[l] % c[k] ==0){
cout<<"(" << c[k] << "," << d[l] << ")";
}
k++;
}
cout<<"}"<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
Posting Komentar