Senin, 17 Juni 2019

kombinatorik

#include <cstdlib>
#include <iostream>
using namespace std;
class Madis{ //deklarasi kelas
public:
 void pilih(); //pendeklarasian fungsi
pilihan
 void permutasi(); //pendeklarasian fungsi
permutasi
 void kombinasi(); //pendeklarasian fungsi
kombinasi
private:
 int q[100];
};
void Madis::pilih(){
 int n;
 cout<<"\n1. Permutasi\n2. kombinasi";
 cout<<"\n\npilihan anda : ";
cin>>n;
 if(n==1)permutasi();
 if(n==2)kombinasi();
 else cout<<"\n\n***selesai***\n\n";
}
void Madis::permutasi(){
// system("cls");
 int n,N,k,K,p;
 cout<<"\nMasukkan nilai n=";cin>>n;
 cout<<"Masukkan nilai r=";cin>>k;
 if(k>n){cout<<"\nNilai r harus kutang dari
n";permutasi();}
 p=n-k;
 N=fak(n);K=fak(p);
 [1]
 cout<<"\nMaka hasil permutasi : "<<N/K;
 cout<<"\n\n";pilih();
}
void Madis::kombinasi(){
// system("cls");
 int n,N=1,k,K=1,p,P=1;
 cout<<"\nMasukkan nilai n=";cin>>n;
 cout<<"Masukkan nilai r=";cin>>k;
 if(k>n){cout<<"\nNilai r harus kutang dari
n";permutasi();}
 p=n-k;N=fak(n);K=fak(k);cout<<"\n(n-r)!->
";P=fak(p); [2]
 cout<<"\nMaka hasil kombinasi : "<<N/(K*P);
 [3]
 cout<<"\n\n";pilih();
}
int main(int argc, char *argv[]) //fungsi main
{
 Madis z;
 z.pilih();

 system("PAUSE");
 return EXIT_SUCCESS;
}
#include<iostream.h>
#include <conio.h>
#include <iomanip.h>
int i, j, k, baris, kolom, m1[10]
[10], m2[10]
[10], hasil[10]
[10];
void main()
{
 clrscr();
cout << "Operasi pertambahan Matrix\n";
 do
 {
 cout << "Jumlah Baris = "; cin>>baris;
 cout << "Jumlah Kolom = "; cin>>kolom;
 }
 while((baris>10)||(kolom>10)); [1]
/* do
 while(kolom>10);*/
 cout << "\nMatrix A" << endl;
 for(i=0;i<baris;i++)
 for(j=0;j<kolom;j++)
 {
 cout <<"data [" << i << "," << j << "] = ";
 cin>>m1[i][j];
 }
 cout << "\nMatrix B" << endl;
 for(i=0;i<baris;i++) [2]
 for(j=0;j<kolom;j++)
 {
 cout <<"data [" << i << "," << j << "] = ";
 cin>>m2[i][j];
 }
 for(i=0; i<baris;i++)
 for(j=0; j<kolom; j++)
 {
 hasil[i][j]=0;
 }
 for (k=0;k<3;k++)
 hasil[i][j] = hasil[i][j]+ m1[i][j] * m2[i][j]; [3]
 cout << "\nHasilnya..." << endl;
 cout << "Matrix A + Matrix B = Matrix C";
 for(i=0; i< baris; i++)
 {
 cout<<'\n';
 for(j=0; j<kolom; j++)
 cout << setw(4) << m1[i][j]; [4]
 cout << " ";
 for(j=0; j<kolom; j++)
 cout << setw(4) << m2[i][j];
 cout << " ";
 for(j=0; j<kolom; j++)
 cout << setw(4) << hasil[i][j];
 cout << endl;
 }
 getch();
}

Selasa, 28 Mei 2019

#include<iostream>
#include<conio.h>
using namespace std;
main(){
bool ketemu,nolsemua;
int matrix[100] [100];
int i,j,jumlah_simpul,jumlah_sisi,asal,tujuan;
//inisialisasi matrix
cout<<"jumlah simpul:";
cin>>jumlah_simpul;

cout<<"jumlah_sisi:";
cin>>jumlah_sisi;
for (i=1;i<=jumlah_simpul;i++)
for (j=1;j<=jumlah_simpul;j++)
matrix[i][j]=0;

//isi matrix sesuai input graf
for (i=1;i<=jumlah_sisi;i++){
cout<<"simpul asal:";
cin>>asal;
cout<<"simpul tujuan:";
cin>>tujuan;
matrix[asal][tujuan]=1;
matrix[tujuan][asal]=1; }
//telusuri graf i=1;nolsemua=false;
while (i<=jumlah_simpul && !nolsemua){
j=1;ketemu=false;
while (j<=jumlah_simpul && !ketemu){
if (matrix[i][j]==1)
ketemu=true;
else
 j++;
 }
 if (!ketemu)
 nolsemua=true;
 else
 i++;
  }
  if(nolsemua)
  cout<<"graf tidak terhubung";
  else cout<<"graf terhubung";

getch();
}

Senin, 20 Mei 2019

<h2>Abdul Afif</h2>
<h2>1800018410</h2>

<div class="table-responsive">

<table class="table" border="1">
<thead>
<tr>
<th>Kalimat</th>
<th>Strlen</th>

<th>Strtolower</th>
<th>Strtoupper</th>
<th>Date</th>
</tr>
</thead>
<?php 

$kalimat = "yogyakarta";
$strlen = strlen($kalimat);

$strtolower = strtolower($kalimat);
$strtoupper = strtoupper($kalimat);
$date = date('l, d F Y');

?>

<?php 

$kalimat2 = "kota";
$strlen2 = strlen($kalimat2);

$strtolower2 = strtolower($kalimat2);
$strtoupper2 = strtoupper($kalimat2);
$date2 = date('l, d F Y');

?>

<?php 

$kalimat3 = "pendidikan";
$strlen3 = strlen($kalimat3);

$strtolower3 = strtolower($kalimat3);
$strtoupper3 = strtoupper($kalimat3);
$date3 = date('l, d F Y');

?>

<tbody>
<tr>
<td><?php echo $kalimat; ?></td>
<td><?php echo $strlen; ?></td>
<td><?php echo $strtolower; ?></td>
<td><?php echo $strtoupper; ?></td>
<td><?php echo $date; ?></td>
</tr>
<tr>
<td><?php echo $kalimat2; ?></td>
<td><?php echo $strlen2; ?></td>
<td><?php echo $strtolower2; ?></td>
<td><?php echo $strtoupper2; ?></td>
<td><?php echo $date2; ?></td>
</tr>
<tr>
<td><?php echo $kalimat3; ?></td>
<td><?php echo $strlen3; ?></td>
<td><?php echo $strtolower3; ?></td>
<td><?php echo $strtoupper3; ?></td>
<td><?php echo $date3; ?></td>
</tr>
</tbody>
</table>

</div>

php pertemuan 9

<h2>Abdul Afif</h2>
<h2>1800018410</h2>

<div class="table-responsive">

<table class="table" border="1">
<thead>
<tr>
<th>Kalimat</th>
<th>Strlen</th>
<th>strpos</th>
<th>Strtolower</th>
<th>Strtoupper</th>
<th>Date</th>
</tr>
</thead>
<?php 

$kalimat = "Universitas";
$strlen = strlen($kalimat);
$strpos = strpos($kalimat,"n");
$strtolower = strtolower($kalimat);
$strtoupper = strtoupper($kalimat);
$date = date("1");

?>

<?php 

$kalimat2 = "Ahmad";
$strlen2 = strlen($kalimat2);
$strpos = strpos($kalimat,"n");
$strtolower2 = strtolower($kalimat2);
$strtoupper2 = strtoupper($kalimat2);
$date = date("H:i:s");

?>

<?php 

$kalimat3 = "Dahlan";
$strlen3 = strlen($kalimat3);
$strtolower3 = strtolower($kalimat3);
$strtoupper3 = strtoupper($kalimat3);
$date = date("H:i:s");

?>

<tbody>
<tr>
<td><?php echo $kalimat; ?></td>
<td><?php echo $strlen; ?></td>
<td><?php echo $strtolower; ?></td>
<td><?php echo $strtoupper; ?></td>
<td><?php echo $date; ?></td>
</tr>
<tr>
<td><?php echo $kalimat2; ?></td>
<td><?php echo $strlen2; ?></td>
<td><?php echo $strtolower2; ?></td>
<td><?php echo $strtoupper2; ?></td>
<td><?php echo $date; ?></td>
</tr>
<tr>
<td><?php echo $kalimat3; ?></td>
<td><?php echo $strlen3; ?></td>
<td><?php echo $strtolower3; ?></td>
<td><?php echo $strtoupper3; ?></td>
<td><?php echo $date; ?></td>
</tr>
</tbody>
</table>

</div>

Minggu, 19 Mei 2019

array 2 dimensi

#include<iostream>
#define max 100
using namespace std;

int main(){
int a[max][max];
int b[max][max];
int n;
cout<<"masukan  nnnya =";cin>>n;
cout<<"input"<<endl;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<"baris ke- "<<i+1<<"kolom ke - "<<j+1<<" : ";
cin>>a[i][j];
}
}
cout<<"input 2"<<endl;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<"baris ke- "<<i+1<<"kolom ke - "<<j+1<<" : ";
cin>>b[i][j];
}
}
cout<<"\n output"<<endl;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<a[i][j]<<" ";
}
cout<<endl;
}
cout<<endl;
cout<<"\n output 2"<<endl;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<b[i][j]<<" ";
}
cout<<endl;
}
cout<<endl;



}

Senin, 13 Mei 2019

#include <iostream>
#include <conio.h>
using namespace std;
int main(){
 const int Ar[7] = {2,4,6,8,9,14,30};
 int tar;

cout<<"masukan data yang dicari : ";
 cin>>tar;
int awal=0, akhir=7, tengah;


 while (awal <= akhir)
  { tengah = (awal + akhir)/2;
  if (tar > Ar[tengah] )     
      { awal = tengah + 1; }
  else if (tar < Ar[tengah]) 
  {akhir= tengah - 1;}
  else {awal = akhir +1;
  }
   }
   if (tar == Ar[tengah])
   {cout<<" Index, Ke- "<<tengah+1<<endl;
   }
   else {
    cout<<"target tidak ditemukan "<<endl;
   }
getch();

}

Minggu, 12 Mei 2019

#include <iostream.h>
#define UKURAN 15
void cetakHeader(void)
{ int i;
cout << "\nSubscript : \n";
for (i=0;i<=UKURAN-1;i++) cout << i << " ";
cout << "\n";
for (i=1; i <= 4*UKURAN; i++) cout << "-";
cout << "\n";
}
void cetakBaris(int b[], int low, int mid, int high)
{ int i;
for (i=0; i<=UKURAN-1; i++)
if (i<low || i>high) cout << " ";
else if (i==mid) cout << "*" << b[i];
else cout << b[i] << " ";
cout << "\n";
}
int pencarianBiner(int b[], int kunciPencarian, int low, int high)
{ int i, middle;
while (low <= high) {
middle = (low+high) / 2;
cetakBaris(b, low, middle, high);
if (kunciPencarian == b[middle])
return middle;
else if (kunciPencarian < b[middle])
high = middle - 1;
else low = middle + 1;
}
return -1;
}
main() {
int a[UKURAN], i, kunci, hasil;
for (i=0; i<=UKURAN-1; i++) a[i] = 2*i;
cout << "Masukkan bilangan antara 0-28 : ";
cin >> kunci;
cetakHeader();
hasil=pencarianBiner(a,kunci,0,UKURAN-1);
if (hasil != -1) cout << kunci
<< " ditemukan pada posisi : "<< hasil;
else
cout << kunci << " tidak ditemukan";
return 0;
#include <iostream>
using namespace std;

int PencarianLinear (int a[], int kunci, int ukuran){
bool ketemu = false;

int n=0;
int i;

while((n<ukuran) && (!ketemu)){
if (a[n] == kunci){
ketemu = true;
i=n;
}
else {
n=n+1;
}
}

if (ketemu){
return i;
}
else {
return -1;
}

}

int main (){
int ukuran =8;
int a[8]={8,4,2,1,7,6,3,5};
int kunci= 6;

cout<<PencarianLinear(a,kunci,ukuran);
}

Selasa, 07 Mei 2019

#include<iostream>
#include<string.h>
#define maks 500
using namespace std;
int main(){
char chiper[maks];
char plain[maks];
int key;
int jumlah=0;

cout<<"masukan kata =";
cin.getline(chiper,sizeof(chiper));

cout<<"masukan key =";
cin>>key;
for(int i=0;i<strlen(chiper);i++){
cout<<chiper[i]<<" ( "<<int(chiper[i])<<" ) ";
jumlah=jumlah+int(chiper[i]);
chiper[i]=(chiper[i]+key)%128;

}
cout<<endl;
cout<<"total ="<<jumlah;

cout<<"\nHasil enkripsi =";
for(int i=0;i<strlen(chiper);i++){
cout<<chiper[i];


}
for(int i=0;i<strlen(chiper);i++){
plain[i]=(chiper[i]-key)%128;
chiper[i]=plain[i];
}

cout<<"\n\nDi Deskripsi menjadi = ";
cout<<"\n Hasil deskripsi = ";
for(int i=0;i<strlen(chiper);i++){
cout<<chiper[i];
}



}

Minggu, 05 Mei 2019

array

#include<iostream>
using namespace std;
void inout(int a[],int n){

for(int i=0;i<n;i++){
}
cout<<"masy=uan bilangan ke"<<i+1
<<" = ";
cin>>a[i];
}
for(int i=0;i<n;i++){
cout<<"bilangan ke:"<<i+1<<" = "<<a[i]<<endl;
}
int main()
{

int a[50],n;
cout<<"masukan banyaknya biangan =";
cin>>n;
inout(a,n);

}

Senin, 29 April 2019

<!DOCTYPE html>
<html>
<head>
<title>Memasukan Bilangan</title>
</head>
<body>

<p><script>
function jumlah()
{
var bil1 = parseFloat(document.fform.bilangan1.value);
if(isNaN (bil1))
bil1 = 0.0;

var bil2 = parseFloat(document.fform.bilangan2.value);
if(isNaN (bil2))
bil2 = 0.0;

var hasil = bil1 * bil2;

alert ("Hasil Perkalian = "+hasil);

var hasil = bil1 / bil2;

alert ("Hasil Pembagian = "+hasil);
var hasil = bil1 + bil2;

alert ("Hasil Penjumlahan = "+hasil);

var hasil = bil1 - bil2;

alert ("Hasil Pengurangan = "+hasil);
}
</script></p>

<form name="fform">
<pre>
Bilangan Pertama : <input type="text" size="11" name="bilangan1">
Bilangan Kedua   : <input type="text" size="11" name="bilangan2">

</pre>
<input type="button" value="Submit" onclick="jumlah()">
<input type="reset" value="ulang">
</p>
</form>

</body>
</html>
<script>
function jumlah(){
var bilangan1 = parseFloat(document.hadi.bill1.value);
var bilangan2 = parseFloat(document.hadi.bill2.value);
var penjumlahan=bilangan1+bilangan2;
alert ("Hasil Penjumlahan : "+penjumlahan);
}
</script>
<form name="hadi">
<pre>
Bilangan Pertama : <input type="text" size="11" name="bill1">
Bilangan Kedua   : <input type="text" size="11" name="bill2">

</pre>
<input type="button" value="Submit" onclick="jumlah()">
<input type="reset" value="ulang">
</p>
</form>

Selasa, 02 April 2019

#include<iostream>
using namespace std;
class hitung {
public:
int proses();
void input();
private:
int n;
float rumus, jumlah,total;
};
void hitung::input(){
cout<<"masukan nilai n =";
cin>>n;
cout<<endl;

}
int hitung::proses(){
jumlah=0;
total=0;
rumus=-1;

for(int i=1;i<=n;i++){
rumus=(rumus*(-1));
total=rumus/i;
jumlah+=total;

if(i==1){
cout<<"("<<total<<")";

}
if(i>1){
cout<<"("<<total<<")";
}
}
cout<<endl<<endl<<"Hasil jumlah deret ="<<jumlah;
return jumlah;

}
int main(){
cout<<"menghitung jumlah dari 1- (1/2) + (1/3) - (1/4) +...+(1/n)";
hitung deret;
deret.input();
deret.proses();
}

Rabu, 20 Maret 2019

#include<iostream>
using namespace std;
int main(){
 string mahasiswa[]={"budi","surti","bambang"};
 string matkul[]={"alpro","matdis","pweb","kcb"};
 string dosen[]={"tio","mulyo","agus","iko"};
 int a[10];
 int b[10];
 int c[10];
 
 cout<<"anggota himpunan mahasiswa ="<<"{";
 for(int i=0;i<3;i++){
  cout<<mahasiswa[i]<<",";
 
 }
 cout<<"}"<<endl;

  cout<<"anggota himpunan mata kuliah ="<<"{";
  for(int i=0;i<4;i++){
  cout<<matkul[i]<<",";
 
 }
 cout<<"}"<<endl;

  cout<<"anggota himpunan dosen ="<<"{";
  for(int i=0;i<4;i++){
  cout<<dosen[i]<<",";
 
 }
 cout<<"}"<<endl;

 cout<<"relasi antara mahasiswa dan matkul"<<"{";
 for(int i=0;i<3;i++){
  for(int j=0;j<4;j++){
  for(int k=0;k<4;k++){
   cout<<"("<<mahasiswa[i]<<","<<matkul[j]<<","<<dosen[k]<<")"<<",";
}
  }
 }
 cout<<"}"<<endl;

 int batas;
 cout<<"masukan batas inputan :";
 cin>>batas;
 for(int i=0;i<batas;i++){
  cout<<"masukan anggota himpunan A ke-"<<i<<" :";
  cin>>a[i];
 }
 for(int j=0;j<batas;j++){
  cout<<"masukan anggota himpunan A ke-"<<j<<" :";
  cin>>b[j];
 }

  for(int k=0;k<batas;k++){
  cout<<"masukan anggota himpunan A ke-"<<k<<" :";
  cin>>c[k];
 }

 cout<<"himpunan A yang habis dibagi anggota Himpunan B =";
 for(int i=0;i<batas;i++){
  for(int j=0;j<batas;j++){
   if(a[i]%b[j]==0){
    cout<<"("<<a[i]<<","<<b[j]<<")"<<",";
      }}}
     
 cout<<"}"<<endl;

  cout<<"himpunan A yang habis dibagi anggota Himpunan c =";
 for(int i=0;i<batas;i++){
  for(int k=0;k<batas;k++){
   if(a[i]%c[k]==0){
    cout<<"("<<a[i]<<","<<c[k]<<")"<<",";
      } }}
     
 cout<<"}"<<endl;
}

Selasa, 19 Maret 2019

#include<iostream>
using namespace std;
int main(){
string mahasiswa[]={"budi","surti","bambang"};
string matkul[]={"alpro","matdis","pweb","kcb"};
int a[10];
int b[10];


cout<<"anggota himpunan mahasiswa ="<<"{";
for(int i=0;i<3;i++){
cout<<mahasiswa[i]<<",";

}
cout<<"}"<<endl;

cout<<"anggota himpunan mata kuliah ="<<"{";
for(int i=0;i<4;i++){
cout<<matkul[i]<<",";

}
cout<<"}"<<endl;
cout<<"relasi antara mahasiswa dan matkul"<<"{";
for(int i=0;i<3;i++){
for(int j=0;j<4;j++){
cout<<"("<<mahasiswa[i]<<","<<matkul[j]<<")"<<",";

}
}
cout<<"}"<<endl;

int batas;
cout<<"masukan batas inputan :";
cin>>batas;
for(int i=0;i<batas;i++){
cout<<"masukan anggota himpunan A ke-"<<i<<" :";
cin>>a[i];
}
for(int j=0;j<batas;j++){
cout<<"masukan anggota himpunan A ke-"<<j<<" :";
cin>>b[j];
}
cout<<"himpunan A yang habis dibagi anggota Himpunan B =";
for(int i=0;i<batas;i++){
for(int j=0;j<batas;j++){
if(a[i]%b[j]==0){
cout<<"("<<a[i]<<","<<b[j]<<")"<<",";
}
}
}
cout<<"}"<<endl;
}

Senin, 18 Maret 2019

<!DOCTYPE html>
<html>
<head>
<style>
table{
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%
}
td,th{
border: 4px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even)
{
background-color: #dddddd;
}
</style>
<title>TABEL</title>
</head>
<body>
<center><h1>Tabel<br></h1></center>
<center><table border="1" cellspacing="0" cellpadding="10"></center>
<tr>
<td>Nama</td>
<td>NIM</td>
<td>Alamat</td>

<td>Foto</td>
</tr>

<tr>
<td>siapa</td>
<td>18430</td>
<td>Sumsel</td>

<td><center><img src="5.jpg" width="70px" height="60px"></center></td>

</table>

</body>
</html>

<!DOCTYPE html>
<html>
<head>
<style>
table{
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%
}
td,th{
border: 4px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even)
{
background-color: #dddddd;
}
</style>
<title>TABEL</title>
</head>
<body>
<center><h1>Tabel<br></h1></center>
<center><table border="1" cellspacing="0" cellpadding="10"></center>
<tr>
<td>Nama</td>
<td>NIM</td>
<td>Alamat</td>
<td>Alamat Profile</td>
<td>Foto</td>
</tr>
<tr>
<td>Arya</td>
<td>18000</td>
<td>Bangka</td>
<td> <a href="qwe.html">hyperlink ke halaman</a></td>
<td><center><img src="qwe.jpg" width="70px" height="60px"></center></td>
</tr>
<tr>
<td>Nugraha</td>
<td>18056</td>
<td>Belitung</td>
<td> <a href="postes.html">hyperlink ke halaman</a></td>
<td><center><img src="2.jpg" width="70px" height="60px"></center></td>
</tr>
<tr>
<td>dia</td>
<td>18220</td>
<td>Riau</td>
<td> <a href="3.html">hyperlink ke halaman</a></td>
<td><center><img src="3.jpg" width="70px" height="60px"></center></td>
</tr>
<tr>
<td>kamu</td>
<td>18130</td>
<td>Jogja</td>
<td> <a href="4.html">hyperlink ke halaman</a></td>
<td><center><img src="4.jpg" width="70px" height="60px"></center></td>
</tr>
<tr>
<td>siapa</td>
<td>18430</td>
<td>Sumsel</td>
<td> <a href="5.html">hyperlink ke halaman</a></td>
<td><center><img src="5.jpg" width="70px" height="60px"></center></td>
</tr>
</table>

</body>
</html>

over

#include <iostream>
using namespace std;

class mahasiswa{
private:
float p,l,t,hasil;
public:


void input(){

cout<<"masukan jari jari =";
cin>>p;

cout<<"masukan tinggi =";
cin>>t;
hasil=3.14*p*p*t;


}
void output(){
cout<<"volumenya adalah ="<<hasil;
}
};
int main(){
mahasiswa c;
c.input();
c.output();
}







#include <iostream>
#include <fstream>
using namespace std;

class persegi{
private:
int s;
int l;
public:
friend istream& operator >> (istream&, persegi&);
friend ostream& operator << (ostream&, const persegi&);

};
istream& operator >> (istream& in, persegi& kk){
cout<<"luas persegi "<<endl;
cout<<"masukan sisi =";
in >>kk.s;
kk.l=kk.s*kk.s;
return in;
}
ostream& operator << (ostream& out, const persegi& kk){
out <<"luasnya ="<<kk.l<<endl;
}
main(){

persegi cc;
cin>>cc;
cout<<cc;
}

Selasa, 12 Maret 2019

#include <iostream>
using namespace std;
int main(){
int i,j,bA,bB,a[100],b[100];

cout<<" jumlah array A : ";cin>>bA;
cout<<endl;
for(i=0;i<bA;i++){
cout<<"Array A ["<<1+i<<"]=";
cin>>a[i];


}

cout<<" jumlah array B : ";cin>>bB;
cout<<endl;
for(j=0;j<bB;j++){
cout<<"Array B ["<<1+j<<"]=";
cin>>b[j];


}
cout<< "isi himpunan A = {";
for(i=0;i<bA;i++){
cout<<a[i]<<" ";


}
cout<< "}";
cout<<endl;
cout<< "isi himpunan B = {";
for(j=0;j<bB;j++){
cout<<b[j]<<" ";


}
cout<< "}";

cout<<endl;
cout<<"irisan himpunan A dan B ={";
for(i=0;i<bA;i++){
for(j=0;j<bB;j++){
if(a[i]==b[j]){
cout<<a[i]<<" ";
}
}
}

cout<<"}";

cout<<endl;
cout<<"gabungan himpunan A dan B ={";
for(i=0;i<bA;i++){
cout<<a[i]<<" ";
}
for(j=0;j<bB;j++){
cout<<b[j]<<" ";
}
cout<<"}";









}