pomoc w opisaniu wierczy C++ builder

0

potrzebuje pomocy w opisaniu wierszy poniższego programu:

#include <vcl.h>
#pragma hdrstop

#include "Kwadracik.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent
Owner)
: TForm(Owner)
{
int n=0;

for(int k=0; k<3; k++)
for(int w=0; w<3; w++)
{
sh[n]=new TButton(Form1);
sh[n]->Top=20+k50;
sh[n]->Left=20+w
50;
sh[n]->Parent=Form1;
sh[n]->Width=50;
sh[n]->Height=50;
sh[n]->Visible=true;
sh[n]->Caption="";
n++;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{

if(Edit1->Text>36||Edit1->Text<0)
{
Edit1->Text==" ";
ShowMessage("Podałes zla liczbe!!! \nPodaj jeszcze raz!!!");
}
else
{
int ile=0;
Label3->Caption=" ";
Button1->Enabled=false;
for(int i=0;i<10;i++)
for(int j=0;j<10;j++)
for(int k=0;k<10;k++)
for(int n=0;n<10;n++)
{
sh[0]->Caption=n;
sh[1]->Caption=k;
sh[3]->Caption=j;
sh[4]->Caption=i;

                                    if((sh[0]->Caption.ToInt()+sh[1]->Caption.ToInt()+sh[3]->Caption.ToInt()+sh[4]->Caption.ToInt())==Edit1->Text)
                                    {
                                            for(int a=0;a<10;a++)
                                                    for(int s=0;s<10;s++)
                                                    {
                                                            sh[2]->Caption=s;
                                                            sh[5]->Caption=a;
                                                            if((sh[1]->Caption.ToInt()+sh[2]->Caption.ToInt()+sh[4]->Caption.ToInt()+sh[5]->Caption.ToInt())==Edit1->Text)
                                                                    {
                                                                    for(int d=0;d<10;d++)
                                                                            for(int f=0;f<10;f++)
                                                                                    {
                                                                                    sh[6]->Caption=f;
                                                                                    sh[7]->Caption=d;
                                                                                    if((sh[3]->Caption.ToInt()+sh[4]->Caption.ToInt()+sh[6]->Caption.ToInt()+sh[7]->Caption.ToInt())==Edit1->Text)
                                                                                            {
                                                                                            for(int g=0;g<10;g++)
                                                                                                    {
                                                                                                    sh[8]->Caption=g;
                                                                                                            if((sh[4]->Caption.ToInt()+sh[5]->Caption.ToInt()+sh[7]->Caption.ToInt()+sh[8]->Caption.ToInt())==Edit1->Text)
                                                                                                            {
                                                                                                                    ile++;
                                                                                                                    Label3->Caption=ile;
                                                                                                                    //ShowMessage("czekaj");
                                                                                                            }
                                                                                                    }
                                                                                            }
                                                                                    }
                                                                    }
                                                    }
                                    }

                    }
    }

}
//---------------------------------------------------------------------------

0
  1. Koloruj składnię
  2. Ten kod to sieczka.

//edit: @furious programming @Shalom 2 dni bez odzewu. Kosz?

1 użytkowników online, w tym zalogowanych: 0, gości: 1