Advertisement
Guest User

vietwow

a guest
Apr 25th, 2010
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 16.42 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<stdlib.h>
  4. #include<dos.h>
  5.  
  6. //Khai bao so phan tu & kieu cua no
  7. const Max_Size=100;
  8. float a[100];
  9. int n;
  10.  
  11. //Tao Menu chon
  12. void menu()
  13. {
  14.    clrscr();
  15.  cout<<"\nHay Chon Chuc Nang:"<<endl;
  16.  cout<<"\n 1.Nhap Du Lieu Bang Tay"<<endl;
  17.  cout<<"\n 2.Su Dung Bo Sinh So Ngau Nhien"<<endl;
  18.  cout<<"\n 3.Tim Kiem Bang PP LinearSeach"<<endl;
  19.  cout<<"\n 4.Tim Kiem Bang PP BinarySearch"<<endl;
  20.  cout<<"\n 5.Sap Xep Bang PP InsertionSort"<<endl;
  21.  cout<<"\n 6.Sap Xep Bang PP SelectionSort"<<endl;
  22.  cout<<"\n 7.Sap Xep Bang PP InterchangeSort"<<endl;
  23.  cout<<"\n 8.Sap Xep Bang PP BubbleSort"<<endl;
  24.  cout<<"\n 9.Sap Xep Bang PP ShakerSort"<<endl;
  25.  cout<<"\n10.Sap Xep Bang PP HeapSort"<<endl;
  26.  cout<<"\n11.Sap Xep Bang PP BInsertionSort"<<endl;
  27.  cout<<"\n12.Sap Xep Bang PP ShellSort"<<endl;
  28.  cout<<"\n13.Sap Xep Bang PP QuickSort"<<endl;
  29.  cout<<"\n14.Sap Xep Bang PP MergeSort"<<endl;
  30.  cout<<"\n15.Sap Xep Bang PP RadixSort"<<endl;
  31.  cout<<"\n16.Giai Thoat"<<endl;
  32.  cout<<"\nChon (1->16): ";
  33. }
  34.  
  35. //Xac lap vung gioi han chon
  36. int chon_menu()
  37. {
  38.    int ch;
  39.    cin>>ch;
  40.    if ((ch >= 1) && (ch <= 16)) return ch;
  41.    else return -1;
  42. }
  43.  
  44. //Thuat toan tim kiem tuyen tinh
  45. int LinearSearch(float a[],int n,int x)
  46. {
  47.  int i=1;
  48.  while((i<n)&&(a[i]!=x)) i++;
  49.  if(a[i]==x) return i;
  50.  else return -1;
  51. }
  52.  
  53. //Thuat toan tim kiem nhi phan
  54. int BinarySearch( float a[], int n, int x)
  55. {
  56.  int l=1,r=n,mid;
  57.  do
  58.   {
  59.    mid=(l+r)/2;
  60.    if(x==a[mid]) return mid;
  61.    else if(x<a[mid]) r=mid-1;
  62.    else l=mid+1;
  63.   }
  64.    while(l<=r);
  65.    return -1;
  66. }
  67.  
  68. // Thuat toan sap xep chen truc tiep
  69. void InsertionSort(float a[],int n)
  70. {
  71.  float temp;
  72.  for(int i=2;i<=n;i++)
  73.   {
  74.    temp=a[i];
  75.    int vt=i;
  76.    while ((a[vt-1]>temp)&&(vt>1))
  77.     {
  78.      a[vt]=a[vt-1];
  79.      vt=vt-1;
  80.     }
  81.    a[vt]=temp;
  82.   }
  83. }
  84.  
  85. //Thuat toan sap xep chon truc tiep
  86. void SelectionSort(float a[],int n)
  87. {
  88.  int min,temp;//la chi so phan tu nho nhat
  89.  for(int i=1;i<=n-1;i++)
  90.   {
  91.    //tim phan tu nho nhat ben phai a[i], tu [a[i]+1->a[n]
  92.    min=i+1;
  93.    for(int j=i+2;j<=n;j++)
  94.    if(a[j]<a[min])min=j;
  95.    if(a[min]<a[i])
  96.     {
  97.      temp=a[i];
  98.      a[i]=a[min];
  99.      a[min]=temp;
  100.     }
  101.   }
  102. }
  103.  
  104. //Thuat toan sap xep doi cho truc tiep
  105. void InterChangeSort(float a[],int n)
  106. {
  107.  int temp;
  108.  for(int i=1;i<n;i++)
  109.  for(int j=i+1;j<=n;j++)
  110.  if(a[i]>a[j])
  111.   {
  112.    temp=a[i];
  113.    a[i]=a[j];
  114.    a[j]=temp;
  115.   }
  116. }
  117.  
  118. //Thuat toan sap xep bang pp noi bot
  119. void BubbleSort(float a[],int n)
  120. {
  121.  int temp;
  122.  for(int i=1;i<n;i++)
  123.  for(int j=n;j>i;j--)
  124.  if(a[j]<a[j-1])
  125.   {
  126.    temp=a[j];
  127.    a[j]=a[j-1];
  128.    a[j-1]=temp;
  129.   }
  130. }
  131.  
  132. //Thuat toan sap xep bang pp ShakerSort
  133. void ShakerSort(float a[],int n)
  134. {
  135.  int l=1,r=n,k=n;
  136.  int temp;
  137.  while (l<r)
  138.   {
  139.    for(int j=r;j>l;j--)
  140.    if(a[j]<a[j-1])
  141.     {
  142.      temp=a[j];
  143.      a[j]=a[j-1];
  144.      a[j-1]=temp;
  145.      k=j;
  146.     }
  147.    l=k;
  148.    for(j=l;j<r;j++)
  149.    if(a[j]>a[j+1])
  150.     {
  151.     temp=a[j];
  152.     a[j]=a[j+1];
  153.     a[j+1]=temp;
  154.     k=j;
  155.     }
  156.    r=k;
  157.   }
  158. }
  159.  
  160. /* Thuat toan sap xep bang pp HeapSort
  161.   1.Chinh Heap */
  162. void ShiftHeap(float a[],int l,int r)
  163. {
  164.  int x,i,j;
  165.  i=l;
  166.  j=2*i;
  167.  x=a[i];
  168.  while(j<=r)
  169.   {
  170.    if(j<r)
  171.    if(a[j]<a[j+1])
  172.    j=j+1;
  173.    if(a[j]<x)break;
  174.    else
  175.     {
  176.      a[i]=a[j];
  177.      a[j]=x;
  178.      i=j;
  179.      j=2*i;
  180.     }
  181.   }
  182. }
  183. // 2.Tao Heap
  184. void CreateHeap(float a[],int n)
  185. {
  186.  int l;
  187.  l=n/2;//a[1] la phan tu ghep them
  188.  while(l>0)
  189.   {
  190.   ShiftHeap(a,l,n);
  191.   l=l-1;
  192.   }
  193. }
  194. // 3.Sap Xep Tren Heap
  195. void HeapSort(float a[],int n)
  196. {
  197.  int temp,r;
  198.  CreateHeap(a,n);
  199.  r=n;// la vi tri dung cho phan tu nho nhat
  200.  while(r>0)
  201.   {
  202.    temp=a[1];
  203.    a[1]=a[r];
  204.    a[r]=temp;
  205.    r=r-1;
  206.    ShiftHeap(a,1,r);
  207.   }
  208. }
  209.  
  210. //Thuat toan sap xep chen nhi phan
  211. void BInsertionSort(float a[],int n)
  212. {
  213.  int l,r,m;
  214.  int x; //luu gia tri a[i] tranh bi ghi de khi doi cho cac phan tu
  215.  for(int i=2;i<=n;i++)
  216.   {
  217.    x=a[i];
  218.    l=1;
  219.    r=i-1;
  220.    while(i<=r) //tim vi tri can chen
  221.     {
  222.      m=(l+r)/2; //tim vi tri thich hop m
  223.      if(i<m) r=m-1;
  224.      else l=m+1;
  225.     }
  226.    int vt=i;
  227.    while((a[vt-1]>x)&&(vt>1))
  228.     {
  229.      a[vt]=a[vt-1];
  230.      vt=vt-1;
  231.     }
  232.    a[vt]=x;
  233.   }
  234. }
  235.  
  236. //Thuat toan sap xep bang pp ShellSort
  237. void ShellSort(float a[],int n,int k)
  238. {
  239.  int step,i,j;
  240.  int x;
  241.  for(step=1;step<=k;step++)
  242.   {
  243.     for(i=1;i<=n;i++)
  244.      {
  245.       x=a[i];
  246.       j=i-1;
  247.       while((x<a[j])&&(j>=1))
  248.        {
  249.     a[j+1]=a[j];
  250.     j=j-1;
  251.        }
  252.       a[j+1]=x;
  253.      }
  254.    }
  255. }
  256.  
  257. //Thuat toan sap xep bang pp QuickSort
  258. void QuickSort(float a[],int l,int r)
  259. {
  260.  int i,j;
  261.  int x;
  262.  i=l;
  263.  j=r;
  264.  x=a[(l+r)/2];
  265.  do
  266.   {
  267.    while (a[i]<x)i++;
  268.    while(a[j]>x)j--;
  269.    if(j<=j)
  270.     {
  271.      if(i<j)
  272.       {
  273.        int temp=a[i];
  274.        a[i]=a[j];
  275.        a[j]=temp;
  276.       }
  277.    i++;
  278.    j--;
  279.      }
  280.    }
  281.    while(i<j);
  282.    if(l<j)QuickSort(a,l,j);
  283.    if(i<r)QuickSort(a,i,r);
  284. }
  285.  
  286. //Tao Merge
  287. void Merge(float a[],int first,int mid,int last)
  288. {
  289.  int first1=first;
  290.  int last1=mid;
  291.  int first2=mid+1;
  292.  int last2=last;
  293.  int i=first1;
  294.  int temp[Max_Size];
  295.  for(i=first1;first1<=last1&&first2<=last2;i++)
  296.    {
  297.     if(a[first1]<a[first2])
  298.      {
  299.       temp[i]=a[first1];
  300.       first1++;
  301.      }
  302.     else
  303.      {
  304.       temp[i]=a[first2];
  305.       first2++;
  306.      }
  307.    }
  308.  for(;first1<=last1;first1++,i++) temp[i]=a[first1];
  309.  for(;first2<=last2;first2++,i++) temp[i]=a[first2];
  310.  for(i=first;i<=last;i++) a[i]=temp[i];
  311. }
  312.  
  313. // Sap Merge
  314. void MergeSort(float a[],int first,int last)
  315. {
  316.  if(first<last)
  317.   {
  318.    int mid=(first+last)/2;
  319.    MergeSort(a,first,mid);
  320.    MergeSort(a,mid+1,last);
  321.    Merge(a,first,mid,last);
  322.   }
  323. }
  324.  
  325. //Tao lo cho tung phan tu cua day
  326. int GetDigit(unsigned long n,int k)
  327. {
  328.  switch(k)
  329.  {
  330.   case 0: return (n%10);
  331.   case 1: return ((n/10)%10);
  332.   case 2: return ((n/100)%10);
  333.   case 3: return ((n/1000)%10);
  334.   case 4: return ((n/10000)%10);
  335.   case 5: return ((n/100000)%10);
  336.   case 6: return ((n/1000000)%10);
  337.   case 7: return ((n/10000000)%10);
  338.   case 8: return ((n/100000000)%10);
  339.   case 9: return ((n/1000000000)%10);
  340.  }
  341.  return n; //Tra ve gia tri neu khong thuoc lo nao
  342. }
  343.  
  344. //Tron lo & Sap lai lo thanh day moi
  345. void RadixSort(float a[],int n,int m)
  346. {
  347.  int j=1,k=0;
  348.  int temp[Max_Size];
  349.  do
  350.   {
  351.    for(int lo=0;lo<=9;lo++) //lo duoc don tu 0->9
  352.    for(int i=1;i<=n;i++) // so phan tu duoc quet lai toan bo theo lo
  353.     {
  354.      int n=GetDigit(a[i],k);
  355.      if(lo==n)
  356.       {
  357.        temp[j]=a[i];
  358.        j++;
  359.       }
  360.     }
  361.    j=1;
  362.    for(int i=1;i<=n;i++) a[i]=temp[i];
  363.    k=k+1;
  364.   }
  365.  while(k<=m);
  366. }
  367.  
  368. //Am thanh bao khoi dong chuong trinh
  369. void Volume()
  370. {
  371.  sound(1800);
  372.  delay(300);
  373.  sound(200);
  374.  delay(150);
  375.  sound(800);
  376.  delay(100);
  377.  sound(600);
  378.  delay(300);
  379.  sound(500);
  380.  delay(250);
  381.  nosound();
  382. }
  383.  
  384. //Thu tuc vao phan tu mang
  385. void input(float a[],int n)
  386. {
  387.  int i;
  388.  for (i = 1; i <= n; i++)
  389.   {
  390.    cout<<"a["<<i<<"]= ";
  391.    cin>>a[i];
  392.   }
  393. }
  394.  
  395. // Thu tuc in ra phan tu mang
  396. void output(float a[],int n)
  397. {
  398.   int i;
  399.   for (i = 1; i <= n; i++)
  400.       cout<<a[i]<<"  ";
  401. }
  402.  
  403. //Chuong trinh chinh
  404. void main()
  405. {
  406.  int x,vt;
  407.  int chon;
  408.  clrscr();//Xoa khong cho hien thi text chon  chuc nang thu 16
  409.  Volume(); // Goi am thanh
  410.  textcolor(10); //Tao mau chu
  411.  cout<<endl<<"\nChuong Trinh Sap Xep Theo Cac Thuat Toan & Tim Kiem Tung Phan Tu";
  412.  cout<<endl<<endl;
  413.  cout<<"Chuong trinh dang chay"; delay(500);
  414.  sound(1000);
  415.  delay(150);
  416.  nosound();
  417.  cout<<"."; delay(500); sound(1000); delay(100); nosound();
  418.  cout<<"."; delay(500); sound(1000); delay(100); nosound();
  419.  cout<<"."; delay(500); sound(1000); delay(100); nosound();
  420.  cout<<"."; delay(500); sound(1000); delay(100); nosound();
  421.  cout<<"."; delay(500); sound(1000); delay(100); nosound();
  422.  cout<<"."; delay(500); sound(1000); delay(100); nosound();
  423.  cout<<"."; delay(500); sound(1000); delay(100); nosound();
  424.  cout<<"."; delay(500); sound(1500); delay(350); nosound();
  425.  cout<<"OK"; delay(500);
  426.  do
  427.   {
  428.    menu();
  429.    chon = chon_menu();
  430.    switch(chon)
  431.     {
  432.      case 1: clrscr();
  433.           sound(350);
  434.           delay(150);
  435.           nosound();
  436.           cout<<"Hay nhap vao so phan tu (1->20): ";
  437.           cin>>n;
  438.           cout<<endl;
  439.           if((n>0)&&(n<=20))
  440.           {
  441.           input(a,n);
  442.           cout<<"\nDay vua nhap la: ";
  443.           output(a,n);
  444.           }
  445.           else cout<<endl<<"Khong hop le !...Quay ve Menu !";
  446.           sound(700);
  447.           delay(150);
  448.           nosound();
  449.           getch();
  450.           break;
  451.  
  452.       case 2: clrscr();
  453.           sound(350);
  454.           delay(150);
  455.           nosound();
  456.           cout<<"Nhap so phan tu can sinh ra (1->20): ";
  457.           cin>>n;
  458.           if((n>0)&&(n<=20))
  459.           {
  460.           cout<<endl<<"Day duoc sinh ra la: ";
  461.           cout<<endl<<endl;
  462.           randomize();
  463.           for(int i=0;i<=n;i++) a[i]=random(1000);
  464.           //So ngau nhien tu 0->1000
  465.           output(a,n);
  466.           }
  467.           else cout<<endl<<"Khong hop le !...Quay ve Menu !";
  468.           sound(700);
  469.           delay(150);
  470.           nosound();
  471.           getch();
  472.           break;
  473.  
  474.       case 3: clrscr();
  475.           sound(350);
  476.           delay(150);
  477.           nosound();
  478.           if(n>0)
  479.           {
  480.           cout<<"Day ban dau: ";
  481.           output(a,n);
  482.           cout<<endl;
  483.           cout<<"\n---Tim kiem theo PP LinearSearch---";
  484.           cout<<endl;
  485.           cout<<"\nNhap phan tu can tim: ";
  486.           cin>>x;
  487.           clrscr();
  488.           vt = LinearSearch(a,n,x);
  489.           cout<<"Day ban dau: ";
  490.           output(a,n);
  491.           cout<<endl;
  492.           if (vt ==-1) cout<<endl<<"\nKhong co phan tu can tim !";
  493.           else
  494.         {
  495.          cout<<endl<<"Co phan tu can tim !"<<endl;
  496.          cout<<endl<<"La so: "<<x;
  497.          cout<<endl<<"\nTai vi tri thu: "<<vt;
  498.         }
  499.           }
  500.           else cout<<"Chua co gi ?...Quay ve Menu !";
  501.           sound(700);
  502.           delay(150);
  503.           nosound();
  504.           getch();
  505.           break;
  506.  
  507.       case 4: clrscr();
  508.           sound(350);
  509.           delay(150);
  510.           nosound();
  511.           if(n>0)
  512.           {
  513.           cout<<"Day ban dau: ";
  514.           output(a,n);
  515.           cout<<endl;
  516.           cout<<"\n---Tim kiem theo PP BinarySearch---";
  517.           cout<<endl;
  518.           cout<<"\nNhap phan tu can tim: ";
  519.           cin>>x;
  520.           clrscr();
  521.           cout<<endl;
  522.           vt = BinarySearch(a,n,x);
  523.           cout<<"Day ban dau: ";
  524.           output(a,n);
  525.           cout<<endl;
  526.           if (vt == -1) cout<<endl<<"\nKhong co phan tu can tim !";
  527.           else
  528.            {
  529.          cout<<endl<<"Co phan tu can tim !"<<endl;
  530.          cout<<endl<<"La so: "<<x;
  531.          cout<<endl<<"\nTai vi tri thu: "<<vt;
  532.         }
  533.           }
  534.           else cout<<"Chua co gi ?...Quay ve Menu !";
  535.           sound(700);
  536.           delay(150);
  537.           nosound();
  538.           getch();
  539.           break;
  540.  
  541.       case 5: clrscr();
  542.           if(n>0)
  543.           {
  544.           cout<<"Day ban dau: ";
  545.           output(a,n);
  546.           cout<<endl;
  547.           cout<<"\nSap xep theo PP InsertionSort:"<<endl;
  548.           cout<<endl;
  549.           InsertionSort(a,n);
  550.           output(a,n);
  551.           }
  552.           else cout<<"Chua co gi ?...Quay ve Menu !";
  553.           sound(700);
  554.           delay(150);
  555.           nosound();
  556.           getch();
  557.           break;
  558.  
  559.       case 6: clrscr();
  560.           if(n>0)
  561.           {
  562.           cout<<"Day ban dau: ";
  563.           output(a,n);
  564.           cout<<endl;
  565.           cout<<"\nSap xep theo PP SelectionSort:"<<endl;
  566.           cout<<endl;
  567.           SelectionSort(a,n);
  568.           output(a,n);
  569.           }
  570.           else cout<<"Chua co gi ?...Quay ve Menu !";
  571.           sound(700);
  572.           delay(150);
  573.           nosound();
  574.           getch();
  575.           break;
  576.  
  577.       case 7: clrscr();
  578.           if(n>0)
  579.           {
  580.           cout<<"Day ban dau: ";
  581.           output(a,n);
  582.           cout<<endl;
  583.           cout<<"\nSap xep theo PP InterchangerSort:"<<endl;
  584.           cout<<endl;
  585.           InterChangeSort(a,n);
  586.           output(a,n);
  587.           }
  588.           else cout<<"Chua co gi ?...Quay ve Menu !";
  589.           sound(700);
  590.           delay(150);
  591.           nosound();
  592.           getch();
  593.           break;
  594.  
  595.       case 8: clrscr();
  596.           if(n>0)
  597.           {
  598.           cout<<"Day ban dau: ";
  599.           output(a,n);
  600.           cout<<endl;
  601.           cout<<"\nSap xep theo PP BubbleSort:"<<endl;
  602.           cout<<endl;
  603.           BubbleSort(a,n);
  604.           output(a,n);
  605.           }
  606.           else cout<<"Chua co gi ?...Quay ve Menu !";
  607.           sound(700);
  608.           delay(150);
  609.           nosound();
  610.           getch();
  611.           break;
  612.  
  613.       case 9: clrscr();
  614.           if(n>0)
  615.           {
  616.           cout<<"Day ban dau: ";
  617.           output(a,n);
  618.           cout<<endl;
  619.           cout<<"\nSap xep theo PP ShakerSort:"<<endl;
  620.           cout<<endl;
  621.           ShakerSort(a,n);
  622.           output(a,n);
  623.           }
  624.           else cout<<"Chua co gi ?...Quay ve Menu !";
  625.           sound(700);
  626.           delay(150);
  627.           nosound();
  628.           getch();
  629.           break;
  630.  
  631.       case 10:clrscr();
  632.           if(n>0)
  633.           {
  634.           cout<<"Day ban dau: ";
  635.           output(a,n);
  636.           cout<<endl;
  637.           cout<<"\nSap xep theo PP HeapSort:"<<endl;
  638.           cout<<endl;
  639.           HeapSort(a,n);
  640.           output(a,n);
  641.           }
  642.           else cout<<"Chua co gi ?...Quay ve Menu !";
  643.           sound(700);
  644.           delay(150);
  645.           nosound();
  646.           getch();
  647.           break;
  648.  
  649.       case 11:clrscr();
  650.           if(n>0)
  651.           {
  652.           cout<<"Day ban dau: ";
  653.           output(a,n);
  654.           cout<<endl;
  655.           cout<<"\nSap xep theo PP BInsertionSort:"<<endl;
  656.           cout<<endl;
  657.           BInsertionSort(a,n);
  658.           output(a,n);
  659.           }
  660.           else cout<<"Chua co gi ?...Quay ve Menu !";
  661.           sound(700);
  662.           delay(150);
  663.           nosound();
  664.           getch();
  665.           break;
  666.  
  667.       case 12:clrscr();
  668.           if(n>0)
  669.           {
  670.           cout<<"Day ban dau: ";
  671.           output(a,n);
  672.           cout<<endl;
  673.           cout<<"\nSap xep theo PP ShellSort:"<<endl;
  674.           cout<<endl;
  675.           ShellSort(a,n,n);
  676.           output(a,n);
  677.           }
  678.           else cout<<"Chua co gi ?...Quay ve Menu !";
  679.           sound(700);
  680.           delay(150);
  681.           nosound();
  682.           getch();
  683.           break;
  684.  
  685.       case 13:clrscr();
  686.           if(n>0)
  687.           {
  688.           cout<<"Day ban dau: ";
  689.           output(a,n);
  690.           cout<<endl;
  691.           cout<<"\nSap xep theo PP QuickSort:"<<endl;
  692.           cout<<endl;
  693.           QuickSort(a,1,n);
  694.           output(a,n);
  695.           }
  696.           else cout<<"Chua co gi ?...Quay ve Menu !";
  697.           sound(700);
  698.           delay(150);
  699.           nosound();
  700.           getch();
  701.           break;
  702.  
  703.       case 14:clrscr();
  704.           if(n>0)
  705.           {
  706.           cout<<"Day ban dau: ";
  707.           output(a,n);
  708.           cout<<endl;
  709.           cout<<"\nSap xep theo PP MergeSort:"<<endl;
  710.           cout<<endl;
  711.           MergeSort(a,1,n);
  712.           output(a,n);
  713.           }
  714.           else cout<<"Chua co gi ?...Quay ve Menu !";
  715.           sound(700);
  716.           delay(150);
  717.           nosound();
  718.           getch();
  719.           break;
  720.  
  721.       case 15:clrscr();
  722.           if(n>0)
  723.           {
  724.           cout<<"Day ban dau: ";
  725.           output(a,n);
  726.           cout<<endl;
  727.           cout<<"\nSap xep theo PP RadixSort:"<<endl;
  728.           cout<<endl;
  729.           RadixSort(a,n,4);
  730.           output(a,n);
  731.           }
  732.           else cout<<"Chua co gi ?...Quay ve Menu !";
  733.           sound(700);
  734.           delay(150);
  735.           nosound();
  736.           getch();
  737.           break;
  738.  
  739.       case 16:clrscr();
  740.           sound(1000);//Am thanh bao chuan bi ket thuc
  741.           delay(100);
  742.           nosound();
  743.           cout<<"\nDang thoat khoi chuong trinh !";
  744.           cout<<".";  delay(150); cout<<".";  delay(150);
  745.           cout<<".";  delay(150); cout<<".";  delay(150);
  746.           cout<<".";  delay(150); cout<<".";  delay(150);
  747.           cout<<".";  delay(150); cout<<".";  delay(150);
  748.           cout<<".";  delay(150); cout<<".";  delay(150);
  749.           cout<<".";  delay(150); cout<<".";  delay(150);
  750.           cout<<endl<<endl;
  751.           cout<<"Nhan mot phim bat ki !";
  752.           sound(1000); //Am thanh ket thuc chuong trinh
  753.           delay(500);
  754.           nosound();
  755.           getch();
  756.           exit(1);
  757.     }
  758.    }
  759.    while (1);
  760. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement