Advertisement
pormanmanullang

NewUAS

Dec 18th, 2018
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 18.95 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <conio.h>
  4. #include <string>
  5. #include <iomanip>
  6. #include <windows>    
  7.  
  8. struct Rental{
  9.     char merk[50],plat[20];
  10.     long harga;
  11. };
  12.  
  13. struct Kasir{
  14.     char merk[50],plat[20],nama_kasir[50],nama_peminjam[50];
  15.     long harga,subtotal,no_mobil,lama_pinjam,uang_bayar,kembali;
  16. };
  17.  
  18. void garis(int &g1, int &g2);
  19. void judul();
  20. void tampilkan(int &g1, int &g2);
  21.  
  22. void mbl(int i,int a);
  23. void psk (int a,int l, int r[10], int p[10], int o, int u,int y);
  24. void mobilu();
  25. void kelompok();
  26. void slotiklan();
  27.  
  28. //ADMIN
  29. void CekDatabaseAdmin(fstream &data);
  30. int JumlahKendaraan(fstream &data);
  31. void TambahKendaraan(fstream &data);
  32. void CatatKendaraan(fstream &data,int posisi,Rental &MobilBaru);
  33. Rental LihatKendaraan(fstream &data, int posisi);
  34. void TampilkanKendaraan(fstream &data);
  35. void PerbaruiKendaraan(fstream &data,int &perbarui,int &g1,int &g2,int &k);
  36.  
  37. //KASIR
  38. void CekDatabaseKasir(fstream &kasir);
  39. void InputRental(fstream &kasir, fstream &data);
  40. int JumlahRental(fstream &kasir);
  41. void CatatRental(fstream &kasir,int posisi,Kasir &InputData);
  42. void TampilkanRental(fstream &kasir);
  43. Kasir LihatRental(fstream &kasir, int posisi);
  44.  
  45. int main()
  46. {
  47.     fstream data,kasir;                                             //Deklarasi Database
  48.     CekDatabaseAdmin(data);                                 //CekDatabaseAdmin
  49.     CekDatabaseKasir(kasir);                                //CekDatabaseKasir
  50.  
  51.     //Struct
  52.     Rental Mobil;
  53.     Kasir Rental;
  54.  
  55.     int mbl1,mbl2;                                      //Untuk Looping Loading
  56.    int psk1,psk2,psk3[10],psk4[10],psk5,psk6,psk7;      //Untuk Looping PSK
  57.     int g1=1, g2;                                           //Untuk Looping Garis
  58.  
  59.     string username,password;                               //Login
  60.     char pw;                                                //Login
  61.  
  62.     int adm_pilih,login_admin,perbarui;                     //Admin
  63.     int i,j,k;                                          //Untuk Looping Pembaruan
  64.  
  65.    int ksr_pilih;                                       //Kasir
  66.  
  67.    mbl(mbl1,mbl2);
  68.     g2=81;
  69.     tampilkan(g1,g2);
  70.    mobilu();
  71.     kelompok();
  72.     slotiklan();
  73.     gotoxy(10,10);cout<<"Masukan Username : ";
  74.         cin>>username;
  75.     gotoxy(10,11);cout<<"Masukan Password : ";
  76.     while(pw != 13){
  77.         pw=_getch();
  78.         if(pw != 13){
  79.             password+=pw;
  80.             cout<<"*";}}
  81.  
  82.     if (username =="admin" && password == "admin"){
  83.         do{
  84.             do{
  85.                 pw=' ';
  86.                 g2=81;
  87.                 tampilkan(g1,g2);
  88.                 cout<<"\n\n\tHalaman Utama Admin\n";
  89.                 g2=49;
  90.                 cout<<"\t"; garis(g1,g2);
  91.                 cout<<"\t= 1. TAMBAH KENDARAAN\t\t\t\t=\n";
  92.                 cout<<"\t= 2. CEK INFORMASI KENDARAAN\t\t\t=\n";
  93.                 cout<<"\t= 3. PERBARUI INFORMASI KENDARAAN\t\t=\n";
  94.                 cout<<"\t= 4. KELUAR\t\t\t\t\t=\n";
  95.                 cout<<"\t"; garis(g1,g2);
  96.                 cout<<"\n\tMasukan Perintah : ";
  97.                     cin>>adm_pilih;
  98.                     cin.clear();
  99.                     cin.ignore();}
  100.             while (adm_pilih != 1 && adm_pilih != 2 && adm_pilih != 3 && adm_pilih != 4);
  101.  
  102.                 if(adm_pilih == 1){
  103.                     g2=81;
  104.                     tampilkan(g1,g2);
  105.                     cout<<"\n\n\tTAMBAH KENDARAAN\n\n";
  106.                     TambahKendaraan(data);
  107.                     getch();}
  108.  
  109.                 else if (adm_pilih == 2){
  110.                     g2=81;
  111.                     tampilkan(g1,g2);
  112.                     cout<<"\n\n\tCEK INFORMASI KENDARAAN\n";
  113.                     g2=52;
  114.                     cout<<"\t";garis(g1,g2);
  115.                     cout<<"\t= No.\tMerk Mobil\tPlat Nomor\tHarga Sewa =\n";
  116.                     cout<<"\t";garis(g1,g2);
  117.                     TampilkanKendaraan(data);
  118.                     cout<<"\t";garis(g1,g2);
  119.                     cout<<"\tTekan Enter untuk kembali";
  120.                     getch();}
  121.  
  122.                 else if (adm_pilih == 3){
  123.                     do{
  124.                         g2=81;
  125.                         tampilkan(g1,g2);
  126.                         cout<<"\n\n\tPERBARUI INFORMASI KENDARAAN\n";
  127.                         g2=52;
  128.                         cout<<"\t";garis(g1,g2);
  129.                         cout<<"\t= No.\tMerk Mobil\tPlat Nomor\tHarga Sewa =\n";
  130.                         cout<<"\t";garis(g1,g2);
  131.                         TampilkanKendaraan(data);
  132.                         cout<<"\t";garis(g1,g2);
  133.                         i = JumlahKendaraan(data);
  134.                         k=0;
  135.                         for(j=0;j<i;j++){
  136.                             k++;}
  137.                         cout<<"\tPilih Kendaraan    : ";
  138.                             cin>>perbarui;
  139.                             cin.clear();
  140.                             cin.ignore();
  141.                         if(perbarui > 0 && perbarui <= k){
  142.                             PerbaruiKendaraan(data,perbarui,g1,g2,k);
  143.                             getch();}}
  144.                     while ( perbarui <1 || perbarui > k);}
  145.  
  146.                 else if(adm_pilih == 4){
  147.              break;}}
  148.         while (true);
  149.       cout<<"\tProgram Selesai..";}
  150.  
  151.     if (username == "kasir" && password == "kasir"){
  152.         cout<<"Kasir";
  153.         do{
  154.             do{
  155.                 pw=' ';
  156.                 g2=81;
  157.                 tampilkan(g1,g2);
  158.                 cout<<"\n\n\tHalaman Utama [KASIR]\n";
  159.                 g2=49;
  160.                 cout<<"\t"; garis(g1,g2);
  161.                 cout<<"\t= 1. INPUT RENTAL\t\t\t\t=\n";
  162.                 cout<<"\t= 2. CEK RIWAYAT RENTAL\t\t\t\t=\n";
  163.                 cout<<"\t= 3. KELUAR\t\t\t\t\t=\n";
  164.                 cout<<"\t"; garis(g1,g2);
  165.                 cout<<"\n\tMasukan Perintah : ";
  166.                     cin>>ksr_pilih;
  167.                     cin.clear();
  168.                     cin.ignore();}
  169.             while (ksr_pilih != 1 && ksr_pilih != 2 && ksr_pilih != 3);
  170.  
  171.                 if(ksr_pilih == 1){
  172.                     g2=81;
  173.                     tampilkan(g1,g2);
  174.                     cout<<"\n\n\tINPUT RENTAL\n";
  175.                     g2=52;
  176.                     cout<<"\t";garis(g1,g2);
  177.                     cout<<"\t= No.\tMerk Mobil\tPlat Nomor\tHarga Sewa =\n";
  178.                     cout<<"\t";garis(g1,g2);
  179.                     TampilkanKendaraan(data);
  180.                     cout<<"\t";garis(g1,g2);
  181.                     InputRental(kasir,data);
  182.                     cout<<"\tTekan Enter untuk kembali";
  183.                     getch();}
  184.  
  185.                 else if (ksr_pilih == 2){
  186.                     g2=81;
  187.                     tampilkan(g1,g2);
  188.                     cout<<"\n\n\tINPUT RENTAL\n";
  189.                     g2=72;
  190.                     cout<<" ";garis(g1,g2);
  191.                     cout<<" = No.\tMerk Mobil    Plat Nomor   Harga Sewa\tLama Rental   Total     =\n";
  192.                     cout<<" ";garis(g1,g2);
  193.                     TampilkanRental(kasir);
  194.                     cout<<" ";garis(g1,g2);
  195.                     getch();}
  196.                 else if (ksr_pilih == 3){
  197.                 break;}}
  198.         while(true);
  199.       cout<<"\tProgram Selesai..";}
  200.  
  201.   getch();
  202. }
  203.  
  204. //ADMIN
  205. void CekDatabaseAdmin(fstream &data){
  206.     data.open("data.bin", ios::out | ios::in | ios::binary);
  207.    // Cek Database
  208.    if (!data.fail()){
  209.    } else {
  210.       data.close();
  211.       data.open("data.bin", ios::trunc | ios::out | ios::in | ios::binary);}
  212.     }
  213.  
  214. int JumlahKendaraan(fstream &data){
  215.    int awal, akhir;
  216.    data.seekg(0,ios::beg);
  217.    awal = data.tellg();
  218.    data.seekg(0,ios::end);
  219.    akhir = data.tellg();
  220.    return (akhir-awal)/sizeof(Rental);
  221.    }
  222.  
  223. Rental LihatKendaraan(fstream &data, int posisi){
  224.     Rental LihatData;
  225.     data.seekg((posisi-1)*sizeof(Rental),ios::beg);
  226.     data.read(reinterpret_cast<char*>(&LihatData),sizeof(Rental));
  227.     return LihatData;
  228.     }
  229.  
  230. void TambahKendaraan(fstream &data){
  231.     Rental TambahData;
  232.     int jumlahdata = JumlahKendaraan(data);
  233.     cout<<"\tMasukan Merk   : ";
  234.         cin.getline(TambahData.merk,20);
  235.     cout<<"\tMasukan Plat No    : ";
  236.         cin.getline(TambahData.plat,20);
  237.     cout<<"\tMasukan Harga  : ";
  238.         cin>>TambahData.harga;
  239.         cin.ignore();
  240.     cout<<"\n\n\tBerhasil Menambah Kendaraan,Tekan Enter untuk kembali\n";
  241.     CatatKendaraan(data,jumlahdata+1,TambahData);
  242.     }
  243.  
  244. void CatatKendaraan(fstream &data,int posisi,Rental &TambahData){
  245.     data.seekp((posisi - 1)*sizeof(Rental), ios::beg);
  246.    data.write(reinterpret_cast<char*>(&TambahData),sizeof(Rental));
  247.     }
  248.  
  249. void TampilkanKendaraan(fstream &data){
  250.     int jumlahdata = JumlahKendaraan(data);
  251.     Rental TampilkanData;
  252.     for(int i=1;i<=jumlahdata;i++){
  253.         TampilkanData = LihatKendaraan(data,i);
  254.         cout<<"\t= "<<i<<"\t";
  255.         cout<<setiosflags(ios::left)<<setw(16)<<TampilkanData.merk;
  256.         cout<<setw(16)<<TampilkanData.plat;
  257.         cout<<setw(11)<<TampilkanData.harga;
  258.         cout<<"="<<endl;}
  259.     }
  260.  
  261. void PerbaruiKendaraan(fstream &data,int &perbarui, int &g1, int &g2, int &k){
  262.     Rental PerbaruiKendaraan;
  263.     if (perbarui > 0 || perbarui <= k){
  264.         PerbaruiKendaraan = LihatKendaraan(data,perbarui);
  265.         cout<<"\t"; garis(g1,g2);
  266.         cout<<"\t"; garis(g1,g2);
  267.         cout<<"\tInformasi Baru"<<endl;
  268.         cout<<"\tMerk Baru  : ";
  269.             cin.getline(PerbaruiKendaraan.merk,50);
  270.         cout<<"\tPlat Baru  : ";
  271.             cin.getline(PerbaruiKendaraan.plat,20);
  272.         cout<<"\tHarga Baru : ";
  273.             cin>>PerbaruiKendaraan.harga;
  274.             cin.ignore();
  275.             cout<<"\tBerhasil memperbarui informasi kendaraan.."<<endl;
  276.             cout<<"\tTekan Enter untuk kembali";
  277.     CatatKendaraan(data,perbarui,PerbaruiKendaraan);}
  278.     }
  279.  
  280. // Kasir
  281. void CekDatabaseKasir(fstream &kasir){
  282. kasir.open("kasir.bin", ios::out | ios::in | ios::binary);
  283.    // Cek Database
  284.    if (!kasir.fail()){}
  285.    else {
  286.       kasir.close();
  287.       kasir.open("kasir.bin", ios::trunc | ios::out | ios::in | ios::binary);}
  288.     }
  289.  
  290. int JumlahRental(fstream &kasir){
  291.    int awal, akhir;
  292.    kasir.seekg(0,ios::beg);
  293.    awal = kasir.tellg();
  294.    kasir.seekg(0,ios::end);
  295.     akhir = kasir.tellg();
  296.    return (akhir-awal)/sizeof(Kasir);
  297.     }
  298.  
  299. void InputRental(fstream &kasir, fstream &data){
  300.     Kasir InputData;
  301.     Rental TampilkanData;
  302.     int jumlahdata = JumlahKendaraan(data);
  303.     int jumlahrental = JumlahRental(kasir);
  304.     cout<<"\tNama Kasir\t\t: ";
  305.         cin.getline(InputData.nama_kasir,50);
  306.     cout<<"\tNama Peminjam\t\t: ";
  307.         cin.getline(InputData.nama_peminjam,50);
  308.     cout<<"\tPilih nomor mobil\t: ";
  309.         cin>>InputData.no_mobil;
  310.     cout<<"\tLama Pinjam [Hari]\t: ";
  311.         cin>>InputData.lama_pinjam;
  312.     for(int i=1;i<=jumlahdata;i++){
  313.         if (i == InputData.no_mobil){
  314.             TampilkanData = LihatKendaraan(data,i);
  315.             strcpy(InputData.merk,TampilkanData.merk);
  316.             strcpy(InputData.plat,TampilkanData.plat);
  317.             InputData.harga = TampilkanData.harga;
  318.             InputData.subtotal = InputData.harga * InputData.lama_pinjam;}}
  319.    cout<<"\tTotal Bayar\t\t: "<<InputData.subtotal<<endl;
  320.    bayar:
  321.    gotoxy(1,(18+jumlahdata));cout<<"\tUang Bayar \t\t: ";
  322.     cin>>InputData.uang_bayar;
  323.       if(InputData.uang_bayar < InputData.subtotal){
  324.         gotoxy(1,(18+jumlahdata));cout<<"\t                                          ";
  325.          goto bayar;}
  326.       else{
  327.         InputData.kembali=InputData.uang_bayar - InputData.subtotal;
  328.          gotoxy(1,(19+jumlahdata));cout<<"\tUang Kembali \t\t: "<<InputData.kembali<<endl;
  329.         CatatRental(kasir,jumlahrental+1,InputData);}
  330.     }
  331.  
  332. void CatatRental(fstream &kasir,int posisi,Kasir &InputData){
  333.     kasir.seekp((posisi - 1)*sizeof(Kasir), ios::beg);
  334.    kasir.write(reinterpret_cast<char*>(&InputData),sizeof(Kasir));
  335.     }
  336.  
  337. Kasir LihatRental(fstream &kasir, int posisi){
  338.     Kasir LihatData;
  339.     kasir.seekg((posisi-1)*sizeof(Kasir),ios::beg);
  340.     kasir.read(reinterpret_cast<char*>(&LihatData),sizeof(Kasir));
  341.     return LihatData;
  342.     }
  343.  
  344. void TampilkanRental(fstream &kasir){
  345.     int jumlahdata = JumlahRental(kasir);
  346.     Kasir TampilkanData;
  347.     for(int i=1;i<=jumlahdata;i++){
  348.         TampilkanData = LihatRental(kasir,i);
  349.         cout<<" = "<<i<<"\t";
  350.         cout<<setiosflags(ios::left)<<setw(14)<<TampilkanData.merk;
  351.         cout<<setw(13)<<TampilkanData.plat;
  352.         cout<<setw(15)<<TampilkanData.harga;
  353.         cout<<setw(1)<<TampilkanData.lama_pinjam;
  354.         cout<<setw(10)<<"hari";
  355.         cout<<setw(10)<<TampilkanData.subtotal;
  356.         cout<<" ="<<endl;}
  357.     }
  358.  
  359. //TAMBAHAN
  360. void garis(int &g1, int &g2){
  361.     for (g1=1;g1<=g2;g1++){
  362.         cout<<"=";}
  363.     cout<<endl;
  364.     }
  365.  
  366. void judul(){
  367.     cout<<"=\t\t\t\t\t\t\t\t\t\t="<<endl;
  368.     cout<<"=\t\t\tRENTAL MOBIL BANG KERUT\t\t\t\t\t="<<endl;
  369.     cout<<"=\t\t\t\t\t\t\t\t\t\t="<<endl;
  370.     }
  371.  
  372. void tampilkan(int &g1, int &g2){
  373.     system("cls");
  374.     garis(g1, g2);
  375.     judul();
  376.     garis(g1, g2);
  377. }
  378.  
  379. void mbl(int i,int a)
  380.     {
  381.     for(a=1;a<70;a++)
  382.       {
  383.         i=15;
  384.         gotoxy(a,i);cout<<"                  _.++-------..,                         \n";
  385.         gotoxy(a,++i);cout<<"            _,-'\\       |      \\._                   \n";
  386.         gotoxy(a,++i);cout<<"     ,-.---'     \\______|__________'--.__            \n";
  387.         gotoxy(a,++i);cout<<" ,_,'     ____           |o=          ____'--._       \n";
  388.         gotoxy(a,++i);cout<<"|\|        / ,, \\  *** LOADING  ***  / / ,, \\    'j_\n";
  389.             gotoxy(a,++i);cout<<"|=======/ .... \\==================/ / .... \\ ===[__]\n";
  390.             gotoxy(a,++i);cout<<" ',_____\\  ''  /__//________\\\\____| \\  ''  /\|_.-'\n";
  391.             gotoxy(a,++i);cout<<"         '----'                      '----'           \n";
  392.          if(a>35)
  393.          {
  394.             i=15;
  395.             gotoxy(1,i);cout<<"                                        ";
  396.             gotoxy(1,++i);cout<<"                                      ";
  397.             gotoxy(1,++i);cout<<"                                      ";
  398.             gotoxy(1,++i);cout<<"                                      ";
  399.             gotoxy(1,++i);cout<<"                                      ";
  400.             gotoxy(1,++i);cout<<"                                      ";
  401.             gotoxy(1,++i);cout<<"                                      ";
  402.             gotoxy(1,++i);cout<<"                                      ";
  403.             gotoxy(1,++i);cout<<"                                      ";
  404.             gotoxy(1,++i);cout<<"                                      ";
  405.          }
  406.       Sleep(100);
  407.       clrscr();}
  408.    }
  409.  
  410. void kelompok()
  411.     {
  412.     gotoxy(50,9);cout<<"================================";
  413.     gotoxy(50,10);cout<<"=  Nama             =    NIM   =";
  414.       gotoxy(50,11);cout<<"================================";
  415.         gotoxy(50,12);cout<<"= Iqmal Firdaus     = 12181723 =";
  416.       gotoxy(50,13);cout<<"= Dwi Purwanto      = 12181155 =";
  417.       gotoxy(50,14);cout<<"= M Habibul K       = 12181404 =";
  418.       gotoxy(50,15);cout<<"= Rizky Maulana     = 12184151 =";
  419.       gotoxy(50,16);cout<<"= Kiki Martin A     = 12184366 =";
  420.       gotoxy(50,17);cout<<"= Porman Manullang  = 12181254 =";
  421.       gotoxy(50,18);cout<<"================================";
  422.    }
  423.  
  424. void slotiklan()
  425.     {
  426.         gotoxy(59,20);cout<<"=======================";
  427.       gotoxy(59,21);cout<<"=                     =";
  428.       gotoxy(59,22);cout<<"=     ADVERTISE       =";
  429.       gotoxy(59,23);cout<<"=                     =";
  430.       gotoxy(59,24);cout<<"=        HERE         =";
  431.       gotoxy(59,25);cout<<"=                     =";
  432.       gotoxy(59,26);cout<<"=======================";
  433.    }
  434.    
  435. void mobilu()
  436.     {
  437.         gotoxy(3,22);cout<<"                  _.++-------..,                      \n";
  438.       gotoxy(3,23);cout<<"            _,-'\\       |      \\._                  \n";
  439.       gotoxy(3,24);cout<<"     ,-.---'     \\______|__________'--.__            \n";
  440.       gotoxy(3,25);cout<<" ,_,'     ____           |o=          ____'--._       \n";
  441.       gotoxy(3,26);cout<<"|\|        / ,, \\  ***WE ARE PSK***  / / ,, \\    'j_\n";
  442.       gotoxy(3,27);cout<<"|=======/ .... \\==================/ / .... \\ ===[__]\n";
  443.       gotoxy(3,28);cout<<" ',_____\\  ''  /__//________\\\\____| \\  ''  /\|_.-'\n";
  444.       gotoxy(3,29);cout<<"         '----'                      '----'           \n";
  445.    }
  446.  
  447. void psk(int a,int l, int r[10],int p[10], int o, int u, int y)
  448.     {
  449.    for(a=1;a<22;a++){
  450.    for(l=1;l<=9;l++)
  451.       {
  452.         if(a<=10){
  453.             if(l == 1){
  454.                 for(o=1;o<=8;o++){
  455.                     r[o]=12;    p[o]=12;}}
  456.                 else if(l == 2){
  457.                 for(o=1;o<=8;o++){
  458.                     r[o]=4; p[o]=4;}}
  459.                 else if(l == 4){
  460.                 for(o=1;o<=8;o++){
  461.                     r[o]=14;    p[o]=14;}}
  462.                 else if(l == 5){
  463.                 for(o=1;o<=8;o++){
  464.                     r[o]=6; p[o]=6;}}
  465.                 else if     (l == 7){
  466.                 for(o=1;o<=8;o++){
  467.                     r[o]=10;    p[o]=10;}}
  468.                 else if     (l == 8){
  469.                 for(o=1;o<=8;o++){
  470.                     r[o]=2; p[o]=2;}}
  471.                 else{for(o=1;o<=8;o++){
  472.                     r[o]=16;    p[o]=16;}}}
  473.  
  474.          if(a==11 || a == 13 || a == 15 || a == 17 || a == 19 || a == 21)
  475.             {
  476.                 if(a==11 || a==17){u=12;}
  477.                else if(a==13 || a==19){u=14;}
  478.                else if(a==15 || a==21){u=10;}
  479.  
  480.                 if(l == 1){r[l]=u; p[l]=u;}
  481.                     else if( l == 2){r[l]=u; p[l]=u;}
  482.                     else if( l == 3){r[l]=u; p[l]=u;}
  483.                     else if( l == 4){r[l]=u; p[l]=u;}
  484.                     else if( l == 5){r[l]=u; p[l]=u;}
  485.                     else if( l == 6){r[l]=u; p[l]=u;}
  486.                     else if( l == 7){r[l]=u; p[l]=u;}
  487.                     else if( l == 8){r[l]=u; p[l]=u;}
  488.                     else{for(o=1;o<=8;o++){r[o]=16; p[o]=16;}}
  489.             }
  490.  
  491.          if(a==12 || a == 14 || a == 16 || a == 18 || a == 20 || a == 22)
  492.             {
  493.                 if(a==12 || a==18){u=4;}
  494.                else if(a==14 || a==20){u=6;}
  495.                else if(a==16 || a==22){u=2;}
  496.  
  497.                 if(l == 1){r[9-l]=u; p[9-l]=u;}
  498.                     else if( l == 2){r[9-l]=u; p[9-l]=u;}
  499.                     else if( l == 3){r[9-l]=u; p[9-l]=u;}
  500.                     else if( l == 4){r[9-l]=u; p[9-l]=u;}
  501.                     else if( l == 5){r[9-l]=u; p[9-l]=u;}
  502.                     else if( l == 6){r[9-l]=u; p[9-l]=u;}
  503.                     else if( l == 7){r[9-l]=u; p[9-l]=u;}
  504.                     else if( l == 8){r[9-l]=u; p[9-l]=u;}
  505.                     else{for(o=1;o<=8;o++){r[o]=16; p[o]=16;}}
  506.             }
  507.  
  508.          gotoxy(20,3);textcolor(r[1]);cprintf("===================================================");
  509.          gotoxy(20,4);textcolor(r[2]);cprintf("===================================================");
  510.          gotoxy(20,5);textcolor(r[3]);cprintf("==    ____________   __________     _       __   ==");
  511.          gotoxy(20,6);textcolor(r[4]);cprintf("==   (  ________  ) (  _______ \\   | |     / /   ==");
  512.          gotoxy(20,7);textcolor(r[5]);cprintf("==   | (        ) | | (       \\/   | |    / /    ==");
  513.          gotoxy(20,8);textcolor(r[6]);cprintf("==   | |        | | | |            | |   / /     ==");
  514.          gotoxy(20,9);textcolor(r[7]);cprintf("==   | |        | | | |            | |  / /      ==");
  515.         gotoxy(20,10);textcolor(r[8]);cprintf("==   | (________) | | (_________   | |_/ /       ==");
  516.         gotoxy(20,11);textcolor(p[8]);cprintf("==   | ___________) (_________  )  |  _ (        ==");
  517.         gotoxy(20,12);textcolor(p[7]);cprintf("==   | |                      ) |  | | \\ \\       ==");
  518.         gotoxy(20,13);textcolor(p[6]);cprintf("==   | |                      | |  | |  \\ \\      ==");
  519.         gotoxy(20,14);textcolor(p[5]);cprintf("==   | |                      | |  | |   \\ \\     ==");
  520.         gotoxy(20,15);textcolor(p[4]);cprintf("==   | |             /\\_______| |  | |    \\ \\    ==");
  521.         gotoxy(20,16);textcolor(p[3]);cprintf("==   |_|             \\__________)  |_|     \\_\\   ==");
  522.         gotoxy(20,17);textcolor(p[2]);cprintf("===================================================");
  523.         gotoxy(20,18);textcolor(p[1]);cprintf("===================================================");
  524.  
  525.         gotoxy(35,21);cout<<"              ___         ";
  526.         gotoxy(35,22);cout<<"             /   )        ";
  527.         gotoxy(35,23);cout<<"      ___   /   /         ";
  528.         gotoxy(35,24);cout<<"     (   \\ /   /__        ";
  529.         gotoxy(35,25);cout<<"      \\   /   /   )__     ";
  530.         gotoxy(35,26);cout<<"       \\ /   /   /   )__  ";
  531.         gotoxy(35,27);cout<<"        /   /   /   /   ) ";
  532.         gotoxy(35,28);cout<<"       /               /  ";
  533.         gotoxy(35,29);cout<<"      {               /   ";
  534.         gotoxy(35,30);cout<<"       \\             /    ";
  535.         gotoxy(35,31);cout<<"        \\           /     ";
  536.         gotoxy(35,32);cout<<"         {         }      ";
  537.         gotoxy(35,33);cout<<"          \\,______}       ";
  538.  
  539.          if(l == 1 || l == 3 || l == 5 || l == 7 || l == 9)
  540.             {y=13;}
  541.          else{y=16;}
  542.          gotoxy(41,19);textcolor(y);cprintf("__   __");
  543.             gotoxy(40,20);textcolor(y);cprintf("(@@\\_/@@)");
  544.             gotoxy(41,21);textcolor(y);cprintf("\\@@@@@/");
  545.         gotoxy(43,22);textcolor(y);cprintf("\\@/");
  546.          if(a<=10){Sleep(500);}
  547.          else{Sleep(500);}
  548.     }
  549.    }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement