ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 로또 생성기
    카테고리 없음 2013. 2. 20. 01:46
    반응형

    -**********************************************************************--
    -- 로또 번호 생성 제작_김광성
    유저가 입력한 숫자 혹은 자동으로 생성된 번호를
    생성된 로또 번호와 체크하여 
    결과를 출력해준다.
    --
    --**********************************************************************--
    #include <iostream>
    #include<stdlib.h>
    #include<time.h>
    #include<windows.h>
    using namespace std;
    -- 로또번호에 사용될 변수들을 전역으로 선언 --
    int GUserL_1=0,GUserL_2=0,GUserL_3=0,GUserL_4=0,GUserL_5=0,GUserL_6=0,GUserL_7=0;//유저의 로또번호
    int GLotto_1=0,GLotto_2=0,GLotto_3=0,GLotto_4=0,GLotto_5=0,GLotto_6=0,GLotto_bonus=0;//로또번호
    int main(void)
    {
    int counter=0;//당첨된 번호 카운터 변수
    int section=1;//로또 횟수
    while (true)
    {//while문 시작
    int select;//메뉴선택 변수
    system("cls");
    cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl;
    cout<<"\t\t▣┌──────────────────┐▣"<<endl;
    cout<<"\t\t▣│           로또 번호 생성           │▣"<<endl;
    cout<<"\t\t▣│                                    │▣"<<endl;
    cout<<"\t\t▣│             1.수동입력             │▣"<<endl;
    cout<<"\t\t▣│             2.자동입력             │▣"<<endl;
    cout<<"\t\t▣│             3.결    과             │▣"<<endl;
    cout<<"\t\t▣│             0.종    료             │▣"<<endl;
    cout<<"\t\t▣└──────────────────┘▣"<<endl;
    cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl<<endl;
    cout<<"\t\t▣ 메뉴 선택 : ";
    cin>>select;
    if (select >= 4)//메뉴번호외의 숫자를 입력시
    {//if 문 시작
    while (true)
     {//while문 시작
     system("cls");
     cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl;
     cout<<"\t\t▣┌──────────────────┐▣"<<endl;
     cout<<"\t\t▣│           로또 번호 생성           │▣"<<endl;
     cout<<"\t\t▣│                                    │▣"<<endl;
     cout<<"\t\t▣│             1.수동입력             │▣"<<endl;
     cout<<"\t\t▣│             2.자동입력             │▣"<<endl;
     cout<<"\t\t▣│             3.결    과             │▣"<<endl;
     cout<<"\t\t▣│             0.종    료             │▣"<<endl;
     cout<<"\t\t▣└──────────────────┘▣"<<endl;
     cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl<<endl;
     cout<<"\t\t▣ 메뉴 선택 : ";
     cin>>select;
     --메뉴에 있는 숫자를 입력시 체크 --
     if (select ==0 || select ==1 || select == 2 || select ==3)
     {//if 문 시작
     break;
     }//if문 종료
     }//while문 종료
    }//if문 종료
    switch (select)
    {//switch시작
    case 1://수동으로 로또 번호를 입력
    {//case 1 시작
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    -- 로또 번호 입력받기--
    cout<<"\t\t▣ 1번 :";
    cin>>GUserL_1;
    if (GUserL_1 >=46)//45보다 큰 수를 입력시 체크 
    {//if문 시작
    while (true)
    {//while 시작
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t▣ 1번 :";
    cin>>GUserL_1;
    if (GUserL_1 <= 45)
      {//if문 시작
        break;
      }//if문 종료
    }//if문 종료
    }//case1 종료
    cout<<"\t\t▣ 2번 :";
    cin>>GUserL_2;
    if (GUserL_2 >=46 || GUserL_1 ==GUserL_2)//45보다 큰 수를 입력시 체크 ,같은 번호를 입력햇는지 체크
    {
    while (true)
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t▣ 1번 :"<<GUserL_1<<"\n";
    cout<<"\t\t▣ 2번 :";
    cin>>GUserL_2;
    if (GUserL_2 <= 45 && GUserL_1 !=GUserL_2)
      {
      break;
      }
    }
    }
    cout<<"\t\t▣ 3번 :";
    cin>>GUserL_3;
    if (GUserL_3 >=46 || GUserL_3 == GUserL_1 || GUserL_3 == GUserL_2)//45보다 큰 수를 입력시 체크 ,두번째와 세번째중 같은수가 있을경우
    {
    while (true)
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t▣ 1번 :"<<GUserL_1<<"\n";
    cout<<"\t\t▣ 2번 :"<<GUserL_2<<"\n";
    cout<<"\t\t▣ 3번 :";
    cin>>GUserL_3;
    if (GUserL_3 <= 45 && GUserL_3 != GUserL_1 && GUserL_3 != GUserL_2)
    {
    break;
    }
    }
    }
    cout<<"\t\t▣ 4번 :";
    cin>>GUserL_4;
    if (GUserL_4 >=46 || GUserL_4 == GUserL_1 || GUserL_4 == GUserL_2 || GUserL_4 == GUserL_3 )//45보다 큰 수를 입력시 체크 ,1,2,3 번째와 같은경우
    {
    while (true)
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t▣ 1번 :"<<GUserL_1<<"\n";
    cout<<"\t\t▣ 2번 :"<<GUserL_2<<"\n";
    cout<<"\t\t▣ 3번 :"<<GUserL_3<<"\n";
    cout<<"\t\t▣ 4번 :";
    cin>>GUserL_4;
    if (GUserL_4 <= 45 && GUserL_4 != GUserL_1 && GUserL_4 != GUserL_2 && GUserL_4 != GUserL_3 )
    {
    break;
    }
    }
    }
    cout<<"\t\t▣ 5번 :";
    cin>>GUserL_5;
    if (GUserL_5 >=46 || GUserL_5 == GUserL_1 || GUserL_5 == GUserL_2 || GUserL_5 == GUserL_3 || GUserL_5==GUserL_4)//45보다 큰 수를 입력시 체크 
    {
    while (true)
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t▣ 1번 :"<<GUserL_1<<"\n";
    cout<<"\t\t▣ 2번 :"<<GUserL_2<<"\n";
    cout<<"\t\t▣ 3번 :"<<GUserL_3<<"\n";
    cout<<"\t\t▣ 4번 :"<<GUserL_4<<"\n";
    cout<<"\t\t▣ 5번 :";
    cin>>GUserL_5;
    if (GUserL_5 <= 45 && GUserL_5 != GUserL_1 && GUserL_5 != GUserL_2 && GUserL_5 != GUserL_3 && GUserL_5!=GUserL_4)
    {
    break;
    }
    }
    }
    cout<<"\t\t▣ 6번 :";
    cin>>GUserL_6;
    if (GUserL_6 >=46 || GUserL_6 ==GUserL_1 || GUserL_6 ==GUserL_2|| GUserL_6 == GUserL_3|| GUserL_6 ==GUserL_4
        || GUserL_6 ==GUserL_5)//45보다 큰 수를 입력시 체크 ,1,2,3,4,5번째와 같은수가잇는지 체크
    {
    while (true)
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t▣ 1번 :"<<GUserL_1<<"\n";
    cout<<"\t\t▣ 2번 :"<<GUserL_2<<"\n";
    cout<<"\t\t▣ 3번 :"<<GUserL_3<<"\n";
    cout<<"\t\t▣ 4번 :"<<GUserL_4<<"\n";
    cout<<"\t\t▣ 5번 :"<<GUserL_5<<"\n";
    cout<<"\t\t▣ 6번 :";
    cin>>GUserL_6;
    if (GUserL_6 <= 45 && GUserL_6 !=GUserL_1 && GUserL_6 !=GUserL_2&& GUserL_6 != GUserL_3&& GUserL_6 !=GUserL_4
    && GUserL_6 !=GUserL_5)
    {
    break;
    }
    }
    }
    cout<<"\t\t▣ 7번 :";
    cin>>GUserL_7;
    if (GUserL_7 >=46 ||GUserL_7==GUserL_1 ||GUserL_7==GUserL_2||GUserL_7==GUserL_3||GUserL_7==GUserL_4||GUserL_7==GUserL_5
        ||GUserL_7==GUserL_6)//45보다 큰 수를 입력시 체크 
    {
    while (true)
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  로 또 번 호 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t▣ 1번 :"<<GUserL_1<<"\n";
    cout<<"\t\t▣ 2번 :"<<GUserL_2<<"\n";
    cout<<"\t\t▣ 3번 :"<<GUserL_3<<"\n";
    cout<<"\t\t▣ 4번 :"<<GUserL_4<<"\n";
    cout<<"\t\t▣ 5번 :"<<GUserL_5<<"\n";
    cout<<"\t\t▣ 6번 :"<<GUserL_6<<"\n";
    cout<<"\t\t▣ 7번 :";
    cin>>GUserL_7;
    if (GUserL_7 <= 45 &&GUserL_7!=GUserL_1 &&GUserL_7!=GUserL_2&&GUserL_7!=GUserL_3&&GUserL_7!=GUserL_4&&GUserL_7!=GUserL_5
    &&GUserL_7!=GUserL_6)
    {
    break;
    }
    }
    }
    //입력된 번호를 출력
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  입 력 번 호 확 인  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t┃"<<GUserL_1<<"┃"
    <<"┃"<<GUserL_2<<"┃"
    <<"┃"<<GUserL_3<<"┃"
    <<"┃"<<GUserL_4<<"┃"
    <<"┃"<<GUserL_5<<"┃"
    <<"┃"<<GUserL_6<<"┃"
    <<"┃"<<GUserL_7<<"┃"<<endl<<endl;
    Sleep(2000);
    system("cls");
    break;
    }//case 1 끝
    case 2:
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  번 호 자 동 입 력  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    Sleep(1000);
    ///////////////////////////
    for(int i = 0; i < 13;i++)
    {
    system("cls");
    cout<<"\t\t자동번호생성중 :";
    for( int j = 0; j <= i; j++ )
    {
    cout<<"▶";
    }
    for( int k = 0; k <= 13-i; k++ )
    {
    cout<<"▷";
    }
    Sleep(250);
    }
    cout<<endl;
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃        ▣  자 동 번 호 결 과  ▣       ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    --랜덤으로 45 숫자중 6개를 생성하여 유저 로또 변수를 .--
    srand((unsigned)time(NULL));
    GUserL_1 = rand()%46+1;
    GUserL_2 = rand()%46+1;
    if (GUserL_1==GUserL_2)
    {
    while (GUserL_1!=GUserL_2)
    {
    GUserL_2 = rand()%46+1;
    break;
    }
    }
    GUserL_3 = rand()%46+1;
    if (GUserL_3==GUserL_1 ||GUserL_3==GUserL_2)
    {
    while (GUserL_3!=GUserL_1 ||GUserL_3!=GUserL_2)
    {
    GUserL_3 = rand()%46+1;
    break;
    }
    }
    GUserL_4 = rand()%46+1;
    if (GUserL_4==GUserL_1 ||GUserL_4==GUserL_2 || GUserL_4==GUserL_3)
    {
    while (GUserL_4!=GUserL_1 ||GUserL_4!=GUserL_2 || GUserL_4!=GUserL_3)
    {
    GUserL_4=rand()%46+1;
    break;
    }
    }
    GUserL_5 = rand()%46+1;
    if (GUserL_5==GUserL_1 ||GUserL_5==GUserL_2 || GUserL_5==GUserL_3 || GUserL_5==GUserL_4)
    {
    while (GUserL_5!=GUserL_1 ||GUserL_5!=GUserL_2 || GUserL_5!=GUserL_3 || GUserL_5!=GUserL_4)
    {
    GUserL_5 = rand()%46+1;
    break;
    }
    }
    GUserL_6 = rand()%46+1;
    if (GUserL_6==GUserL_1 ||GUserL_6==GUserL_2 || GUserL_6==GUserL_3 || GUserL_6==GUserL_4 || GUserL_6== GUserL_5)
    {
    while (GUserL_6!=GUserL_1 ||GUserL_6!=GUserL_2 || GUserL_6!=GUserL_3 || GUserL_6!=GUserL_4 || GUserL_6!= GUserL_5)
    {
    GUserL_6 = rand()%46+1;
    break;
    }
    }
    GUserL_7 = rand()%46+1;
    if (GUserL_7==GUserL_1 ||GUserL_7==GUserL_2 || GUserL_7==GUserL_3 || GUserL_7==GUserL_4 || GUserL_7== GUserL_5 || GUserL_7==GUserL_6 )
    {
    while (GUserL_7!=GUserL_1 ||GUserL_7!=GUserL_2 || GUserL_7!=GUserL_3 || GUserL_7!=GUserL_4 || GUserL_7!= GUserL_5 || GUserL_7!=GUserL_6)
    {
    GUserL_7 = rand()%46+1;
    break;
    }
    }
    cout<<"\t\t┃"<<GUserL_1<<"┃"
    <<"┃"<<GUserL_2<<"┃"
    <<"┃"<<GUserL_3<<"┃"
    <<"┃"<<GUserL_4<<"┃"
    <<"┃"<<GUserL_5<<"┃"
    <<"┃"<<GUserL_6<<"┃"
    <<"┃"<<GUserL_7<<"┃"<<endl<<endl;
    Sleep(4500);
    system("cls");
    }
       break;
    case 3:
    {
    system("cls");
    cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl;
    cout<<"\t\t▣┌──────────────────┐▣"<<endl;
    cout<<"\t\t▣│           로또 추첨 결과           │▣"<<endl;
    cout<<"\t\t▣└──────────────────┘▣"<<endl;
    cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl<<endl;
    ///////////////////////////
    for(int i = 0; i < 13;i++)
    {
    system("cls");
    cout<<"\t\t로또체크중 :";
    for( int j = 0; j <= i; j++ )
    {
    cout<<"▶";
    }
    for( int k = 0; k <= 13-i; k++ )
    {
    cout<<"▷";
    }
    Sleep(250);
    }
    cout<<endl;
    system("cls");
    cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl;
    cout<<"\t\t▣┌──────────────────┐▣"<<endl;
    cout<<"\t\t▣│           로또 추첨 결과           │▣"<<endl;
    cout<<"\t\t▣└──────────────────┘▣"<<endl;
    cout<<"\t\t▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣"<<endl<<endl;
    --당첨번호 생성/유저의 번호와 로또번호 비교--
    srand((unsigned)time(NULL));
    GLotto_1=rand()%45;
    GLotto_2=rand()%45;
    GLotto_3=rand()%45;
    GLotto_4=rand()%45;
    GLotto_5=rand()%45;
    GLotto_6=rand()%45;
    GLotto_bonus=rand()%45;
    --로또번호 출력--
    cout<<"\tSGA_LOTTO "<<section<<"회"<<"┃"<<GLotto_1<<"┃"
    <<"┃"<<GLotto_2<<"┃"
    <<"┃"<<GLotto_3<<"┃"
    <<"┃"<<GLotto_4<<"┃"
    <<"┃"<<GLotto_5<<"┃"
    <<"┃"<<GLotto_6<<"┃"
    <<"┃"<<GLotto_bonus<<"┃"<<endl<<endl;
    cout<<"\t\t 당첨번호 :";
    ///첫번째 와 같은 번호가 잇는지 검사
    if (GLotto_1 == GUserL_1 || GLotto_1 == GUserL_2 || GLotto_1 == GUserL_3 || GLotto_1 == GUserL_4 || 
        GLotto_1 == GUserL_5 || GLotto_1 == GUserL_6 || GLotto_1 == GUserL_7)
    {
    cout<<"┃"<<GLotto_1<<"┃";
    counter ++;
    }
    ///두번째 와 같은 번호가 잇는지 검사
    if (GLotto_2 == GUserL_1 || GLotto_2 == GUserL_2 || GLotto_2 == GUserL_3 || GLotto_2 == GUserL_4 || 
    GLotto_2 == GUserL_5 || GLotto_2 == GUserL_6 || GLotto_2 == GUserL_7)
    {
    cout<<"┃"<<GLotto_2<<"┃";
    counter ++;
    }
    ///세번째 와 같은 번호가 잇는지 검사
    if (GLotto_3 == GUserL_1 || GLotto_3 == GUserL_2 || GLotto_3 == GUserL_3 || GLotto_3 == GUserL_4 || 
    GLotto_3 == GUserL_5 || GLotto_3 == GUserL_6 || GLotto_3 == GUserL_7)
    {
    cout<<"┃"<<GLotto_3<<"┃";
    counter ++;
    }
    ///네번째 와 같은 번호가 잇는지 검사
    if (GLotto_4 == GUserL_1 || GLotto_4 == GUserL_2 || GLotto_4 == GUserL_3 || GLotto_4 == GUserL_4 || 
    GLotto_4 == GUserL_5 || GLotto_4 == GUserL_6 || GLotto_4 == GUserL_7)
    {
    cout<<"┃"<<GLotto_4<<"┃";
    counter ++;
    }
    ///다섯번째 와 같은 번호가 잇는지 검사
    if (GLotto_5 == GUserL_1 || GLotto_5 == GUserL_2 || GLotto_5 == GUserL_3 || GLotto_5 == GUserL_4 || 
    GLotto_5 == GUserL_5 || GLotto_5 == GUserL_6 || GLotto_5 == GUserL_7)
    {
    cout<<"┃"<<GLotto_5<<"┃";
    counter ++;
    }
    ///여섯번째 와 같은 번호가 잇는지 검사
    if (GLotto_6 == GUserL_1 || GLotto_6 == GUserL_2 || GLotto_6 == GUserL_3 || GLotto_6 == GUserL_4 || 
    GLotto_6 == GUserL_5 || GLotto_6 == GUserL_6 || GLotto_6 == GUserL_7)
    {
    cout<<"┃"<<GLotto_6<<"┃";
    counter ++;
    }
    ///보너스와 같은 번호가 잇는지 검사
    if (GLotto_bonus==GUserL_1||GLotto_bonus==GUserL_2||GLotto_bonus==GUserL_3||GLotto_bonus== GUserL_4 || 
    GLotto_bonus == GUserL_5 || GLotto_bonus == GUserL_6 || GLotto_bonus == GUserL_7)
    {
    counter ++;
    //counter =5;
    if(counter==5)
          {   
      cout<<"\t\t                 ●┳━┓                 ┃"<<endl;
      cout<<"\t\t                   ┛  ┗                 ┃"<<endl;
      cout<<"\t\t                  ■■■■                ┃"<<endl;
      
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃▣ 당첨금 000,000,000,000,000,001.원 ▣ ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    --로또번호추출을 다시하기위하여 전역변수를 0 으로 초기화 시킴 --
    GUserL_1=0,GUserL_2=0,GUserL_3=0,GUserL_4=0,GUserL_5=0,GUserL_6=0,GUserL_7=0;//유저의 로또번호
    GLotto_1=0,GLotto_2=0,GLotto_3=0,GLotto_4=0,GLotto_5=0,GLotto_6=0,GLotto_bonus=0;//로또번호
    counter =0;
    section++;
    Sleep(9000);
    break;
      }
    cout<<"┃"<<"보너스:"<<GLotto_bonus<<"┃";
    }
    //counter =6;
    if (counter >=6)
    {
    system("cls");
    for(int i=0;i<100;i++)
      {
    system("cls");
    cout<<"\t\t                          .*        "<<endl; 
    cout<<"\t\t      *.                            "<<endl; 
    cout<<"\t\t              .*            .*      "<<endl; 
    cout<<"\t\t     *.                        .*   "<<endl; 
    cout<<"\t\t       *.             .*            "<<endl;
    cout<<"\t\t     *.     *.┏┓┏┓.*축    .*    "<<endl; 
    cout<<"\t\t            ┏┻┫┣┻┓하          "<<endl; 
    cout<<"\t\t     *.     ┃━┫┣━┃해      .*  "<<endl; 
    cout<<"\t\t            ┃━┫┣━┃요~         "<<endl; 
    cout<<"\t\t        *.  ┗━┛┗━┛            "<<endl; 
    cout<<"\t\t                                    "<<endl; 
    cout<<"\t\t           *.                       "<<endl; 
    cout<<"\t\t            *.             .*       "<<endl; 
       }
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃▣ 당첨금 100,000,000,000,000,000.원 ▣ ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    Sleep(10000);
    system("cls");
    --로또번호추출을 다시하기위하여 전역변수를 0 으로 초기화 시킴 --
    GUserL_1=0,GUserL_2=0,GUserL_3=0,GUserL_4=0,GUserL_5=0,GUserL_6=0,GUserL_7=0;//유저의 로또번호
    GLotto_1=0,GLotto_2=0,GLotto_3=0,GLotto_4=0,GLotto_5=0,GLotto_6=0,GLotto_bonus=0;//로또번호
    counter =0;
    section++;
    }
    else if(counter <=5)
    {
    cout<<endl<<endl;
    cout<<"\t\t┃                                          ┃"<<endl;
    cout<<"\t\t┃                 ●┳━┓                 ┃"<<endl;
    cout<<"\t\t┃                   ┛  ┗                 ┃"<<endl;
    cout<<"\t\t┃                  ■■■■                ┃"<<endl;
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃▣ 당첨금 000,000,000,000,000,000.원 ▣ ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    cout<<"\t\t 맞은개수 :"<<counter<<endl;
    --로또번호추출을 다시하기위하여 전역변수를 0 으로 초기화 시킴 --
    GUserL_1=0,GUserL_2=0,GUserL_3=0,GUserL_4=0,GUserL_5=0,GUserL_6=0,GUserL_7=0;//유저의 로또번호
    GLotto_1=0,GLotto_2=0,GLotto_3=0,GLotto_4=0,GLotto_5=0,GLotto_6=0,GLotto_bonus=0;//로또번호
    counter =0;
    section++;
    Sleep(9000);
    break;
    }
        else if(counter ==0)
    {
    cout<<"없음 :";
    --로또번호추출을 다시하기위하여 전역변수를 0 으로 초기화 시킴 --
    GUserL_1=0,GUserL_2=0,GUserL_3=0,GUserL_4=0,GUserL_5=0,GUserL_6=0,GUserL_7=0;//유저의 로또번호
    GLotto_1=0,GLotto_2=0,GLotto_3=0,GLotto_4=0,GLotto_5=0,GLotto_6=0,GLotto_bonus=0;//로또번호
    counter =0;
    section++;
    }
    cout<<"\t\t 맞은개수 :"<<counter<<endl;
    --로또번호추출을 다시하기위하여 전역변수를 0 으로 초기화 시킴 --
    GUserL_1=0,GUserL_2=0,GUserL_3=0,GUserL_4=0,GUserL_5=0,GUserL_6=0,GUserL_7=0;//유저의 로또번호
    GLotto_1=0,GLotto_2=0,GLotto_3=0,GLotto_4=0,GLotto_5=0,GLotto_6=0,GLotto_bonus=0;//로또번호
    counter =0;
    section++;//횟수 카운터;
    }
    break;
     case 0:
    {
    system("cls");
    cout<<"\t\t┏━━━━━━━━━━━━━━━━━━━━┓"<<endl;
    cout<<"\t\t┃   ▣ 로또 생성기 를 종료 합니다.  ▣   ┃"<<endl;
    cout<<"\t\t┗━━━━━━━━━━━━━━━━━━━━┛"<<endl;
    Sleep(1000);
    system("cls");
    }
    break;
    }//스위치 끝
    if (select == 0)//종료를 위한 if 문 
    {
      break;
    }
    }//while문 끝
    return 0;
    }

    반응형
Designed by Tistory.