C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[60980] 벤다이어그램을 짜고있는데요...
홀로롤로로로롤롤로로 [rimal] 946 읽음    2010-05-06 19:37
int ax=0,bx=0,a[4],b[4],c=0,fnr=0;
    a[0] = StrToInt(Edit1->Text);
    a[1] = StrToInt(Edit2->Text);
    a[2] = StrToInt(Edit3->Text);
    a[3] = StrToInt(Edit4->Text);
    b[0] = StrToInt(Edit5->Text);
    b[1] = StrToInt(Edit6->Text);
    b[2] = StrToInt(Edit7->Text);
    b[3] = StrToInt(Edit8->Text);
    for(ax=0;ax<4;ax++)
    {
        for(bx=0;bx<4;bx++)
        {
       // c=c+1;
            if(a[ax]==b[bx])
            {
       //         if(fnr==0)
         //       {
                    Label12->Show();
                    Label13->Show();
                    Label14->Show();
                    Label15->Show();
//                Label16->Show();
  //              Label17->Show();
     //           Label18->Show();
       //         Label19->Show();
                    Label20->Show();
                    Label21->Show();
                    Label22->Show();
                    Label23->Show();
                    Label12->Caption=Edit1->Text;
                    Label13->Caption=Edit2->Text;
                    Label14->Caption=Edit3->Text;
                    Label15->Caption=Edit4->Text;
                    Label20->Caption=Edit5->Text;
                    Label21->Caption=Edit6->Text;
                    Label22->Caption=Edit7->Text;
                    Label23->Caption=Edit8->Text;
                    c=c+1;
                    fnr=1;
           //    }
                if(c==1)
                {
                    Label16->Caption = a[ax];
                    Label16->Show();
                    if(Label12->Caption == a[ax])
                    {
                        Label12->Hide();
                    }
                    if(Label13->Caption == a[ax])
                    {
                        Label13->Hide();
                    }
                    if(Label14->Caption == a[ax])
                    {
                        Label14->Hide();
                    }
                    if(Label15->Caption == a[ax])
                    {
                        Label15->Hide();
                    }
                    if(Label20->Caption == a[ax])
                    {
                        Label20->Hide();
                    }
                    if(Label21->Caption == a[ax])
                    {
                        Label21->Hide();
                    }
                    if(Label22->Caption == a[ax])
                    {
                        Label22->Hide();
                    }
                    if(Label23->Caption == a[ax])
                    {
                        Label23->Hide();
                    }

                }
                if(c==2)
                {
                    Label17->Caption = a[ax];
                    Label17->Show();
                    if(Label12->Caption == a[ax])
                    {
                        Label12->Hide();
                    }
                    if(Label13->Caption == a[ax])
                    {
                        Label13->Hide();
                    }
                    if(Label14->Caption == a[ax])
                    {
                        Label14->Hide();
                    }
                    if(Label15->Caption == a[ax])
                    {
                        Label15->Hide();
                    }
                    if(Label20->Caption == a[ax])
                    {
                        Label20->Hide();
                    }
                    if(Label21->Caption == a[ax])
                    {
                        Label21->Hide();
                    }
                    if(Label22->Caption == a[ax])
                    {
                        Label22->Hide();
                    }
                    if(Label23->Caption == a[ax])
                    {
                        Label23->Hide();
                    }

                }
                if(c==3)
                {
                    Label18->Caption = a[ax];
                    Label18->Show();
                    if(Label12->Caption == a[ax])
                    {
                        Label12->Hide();
                    }
                    if(Label13->Caption == a[ax])
                    {
                        Label13->Hide();
                    }
                    if(Label14->Caption == a[ax])
                    {
                        Label14->Hide();
                    }
                    if(Label15->Caption == a[ax])
                    {
                        Label15->Hide();
                    }
                    if(Label20->Caption == b[bx])
                    {
                        Label20->Hide();
                    }
                    if(Label21->Caption == b[bx])
                    {
                        Label21->Hide();
                    }
                    if(Label22->Caption == b[bx])
                    {
                        Label22->Hide();
                    }
                    if(Label23->Caption == b[bx])
                    {
                        Label23->Hide();
                    }

                }
                if(c==4)
                {
                    Label19->Caption = a[ax];
                    Label19->Show();
                    if(Label12->Caption == a[ax])
                    {
                        Label12->Hide();
                    }
                    if(Label13->Caption == a[ax])
                    {
                        Label13->Hide();
                    }
                    if(Label14->Caption == a[ax])
                    {
                        Label14->Hide();
                    }
                    if(Label15->Caption == a[ax])
                    {
                        Label15->Hide();
                    }
                    if(Label20->Caption == b[bx])
                    {
                        Label20->Hide();
                    }
                    if(Label21->Caption == b[bx])
                    {
                        Label21->Hide();
                    }
                    if(Label22->Caption == b[bx])
                    {
                        Label22->Hide();
                    }
                    if(Label23->Caption == b[bx])
                    {
                        Label23->Hide();
                    }
                }
            }
            else
            {

            }

        }
    }

    a[ax]=a[ax]-a[ax];
    b[bx]=b[bx]-b[bx];
    c=c-c;

첫번째껀 괜찮은데 두번째부터 숫자가 엉키기 시작하네요...
해결방법점,,

+ -

관련 글 리스트
60980 벤다이어그램을 짜고있는데요... 홀로롤로로로롤롤로로 946 2010/05/06
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.