Скачиваний:
0
Добавлен:
30.05.2020
Размер:
22.09 Кб
Скачать
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "math.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
int NSK(int,int);
int NSD(int,int);
float max(float,float);
float min(float,float);
float Plosha(float);
float Apofema(float);
int index=0,razm=3;
int pods(int sum, int number)
{
   return !number ? sum : pods(sum + 1, number / 10);
}

int podc(int number)
{
   return !number ? 1 : pods(0, number);
}
int prv(int n)
{
    register int d;

    for (d=2; d<=n/2; d++)
        if (n%d==0)
            return 0;
    return 1;
}
int NSD(int x,int y)
{
  while(x!=y)
  {
    if(x<y) y-=x;
    else  x-=y;
  }
  return x;
}
int NSK(int x, int y)
{
  return x*y/NSD(x,y);
}
float max(float x,float y)
{
  if(x>y)
    return x;
  else
    return y;
}
float min(float x,float y)
{
  if(x<y)
    return x;
  else
    return y;
}
float Plosha(float x)
{
  return 0.5*x*Apofema(x);
}
float Apofema(float x)
{
  return x/(2*tan(3.14/6));
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int k,i,n,c,s=0;
index=0;
k=StrToInt(Edit1->Text);
n=StrToInt(Edit2->Text);
if (n>5000) {ShowMessage("Число n занадто велике"); Edit2->SetFocus(); return;}
if (k>=n || k>30 || k<=0) {ShowMessage("Число k не входить в допустимі межі"); Edit1->SetFocus(); return;}
//for (i=k;i<n;i++) {
i=k;
while (i<n) {
   c=i%10; s=c;
   c=(i/10)%10; s=s+c;
   c=(i/100)%10; s=s+c;
   c=(i/1000)%10; s=s+c;
   if (s == k) {StringGrid1->ColCount=index+1;StringGrid1->Cells[index][0]=IntToStr(i);
   index++; }
   if (index>18) StringGrid1->Height=39;
   i++;
 }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit2KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit3KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;
}
//---------------------------------------------------------------------------


void __fastcall TForm1::StringGrid2KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',') Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::StringGrid3KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',') Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::StringGrid4KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',') Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)
{
Edit1->Clear();
Edit2->Clear();
for (int i=0;i<index;i++)
  StringGrid1->Cells[i][0]="";
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button5Click(TObject *Sender)
{
for (int i=0;i<razm;i++)
   for(int j=0;j<razm;j++)
      { StringGrid2->Cells[i][j]="";
      StringGrid3->Cells[i][j]="";
      StringGrid4->Cells[i][j]="";
      StringGrid5->Cells[i][j]="";
   }
Edit3->Clear();
}
//---------------------------------------------------------------------------


void __fastcall TForm1::FormCreate(TObject *Sender)
{
  StringGrid2->ColCount=razm;
  StringGrid3->ColCount=razm;
  StringGrid4->ColCount=razm;
  StringGrid5->ColCount=razm;

  StringGrid2->RowCount=razm;
  StringGrid3->RowCount=razm;
  StringGrid4->RowCount=razm;
  StringGrid5->RowCount=razm;
  randomize;
  for (int i=0;i<razm;i++)
     for(int j=0;j<razm;j++)  {
      StringGrid2->Cells[i][j]=IntToStr(random(20)-9);
      StringGrid3->Cells[i][j]=IntToStr(random(20)-9);
      StringGrid4->Cells[i][j]=IntToStr(random(20)-9);
  }
  Button3->Enabled=false;
  Memo1->Clear();
  Memo2->Clear();
  MediaPlayer1->Hide();
  RadioGroup1->ItemIndex=0;
  Edit7->Hide();Edit8->Hide();Edit9->Hide();Edit10->Hide();Edit11->Hide();Edit12->Hide();Edit13->Hide();Edit14->Hide();
Label11->Hide();Label12->Hide();Label13->Hide();Label14->Hide();Label15->Hide();Label16->Hide();Label17->Hide();Label18->Hide();Label19->Hide();
Button13->Hide();Button14->Hide();Button16->Hide();
Label23->Caption="";
   Label27->Caption="";
   Label26->Visible=false;
   Label24->Visible=false;
   Label25->Visible=false;
   Memo3->Clear();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button3Click(TObject *Sender)
{
razm=StrToInt(Edit3->Text);
  StringGrid2->ColCount=razm;
  StringGrid3->ColCount=razm;
  StringGrid4->ColCount=razm;
  StringGrid5->ColCount=razm;

  StringGrid2->RowCount=razm;
  StringGrid3->RowCount=razm;
  StringGrid4->RowCount=razm;
  StringGrid5->RowCount=razm;

  for (int i=0;i<razm;i++)
     for(int j=0;j<razm;j++)  {
      StringGrid2->Cells[i][j]=IntToStr(random(20)-9);
      StringGrid3->Cells[i][j]=IntToStr(random(20)-9);
      StringGrid4->Cells[i][j]=IntToStr(random(20)-9);
  }
}
//---------------------------------------------------------------------------


void __fastcall TForm1::Button4Click(TObject *Sender)
{
  int i,j;
      for (i=0;i<razm;i++)
     for(j=0;j<razm;j++) {
       if (StringGrid2->Cells[i][j]=="" || StringGrid3->Cells[i][j]=="" || StringGrid4->Cells[i][j]=="") {
          ShowMessage("Заповніть масив");
       return; }
     }
     int max1=StrToInt(StringGrid2->Cells[0][0]),max2=StrToInt(StringGrid3->Cells[0][0]),max3=StrToInt(StringGrid4->Cells[0][0]);
 // int a[razm],b[razm],c[razm];
 for (i=0;i<razm;i++)
     for(j=0;j<razm;j++) {
       if (StrToInt(StringGrid2->Cells[i][j])>max1) max1=StrToInt(StringGrid2->Cells[i][j]);
       if(StrToInt(StringGrid3->Cells[i][j])>max2) max2=StrToInt(StringGrid3->Cells[i][j]);
       if(StrToInt(StringGrid4->Cells[i][j])>max3) max3=StrToInt(StringGrid4->Cells[i][j]);
 }
 if (max1<max2 && max1<max3)
     for (i=0;i<razm;i++)
     for(j=0;j<razm;j++)
     StringGrid5->Cells[i][j]=StringGrid2->Cells[i][j];
 else if (max2<max1 && max2<max3)
     for (i=0;i<razm;i++)
     for(j=0;j<razm;j++)
     StringGrid5->Cells[i][j]=StringGrid3->Cells[i][j];
 else
     for (i=0;i<razm;i++)
     for(j=0;j<razm;j++)
     StringGrid5->Cells[i][j]=StringGrid4->Cells[i][j];
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit3Change(TObject *Sender)
{
if (Edit3->Text.Length()>0) Button3->Enabled=true;
else Button3->Enabled=false;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button7Click(TObject *Sender)
{
Edit4->Clear();
Memo1->Clear();
}
//---------------------------------------------------------------------------


void __fastcall TForm1::Memo1KeyPress(TObject *Sender, char &Key)
{
Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit4KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;        
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

void __fastcall TForm1::Memo2KeyPress(TObject *Sender, char &Key)
{
Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit5KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button9Click(TObject *Sender)
{
Edit5->Clear();
Memo2->Clear();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button8Click(TObject *Sender)
{
int n=StrToInt(Edit5->Text);
if (n<284) {ShowMessage("В даних межах дружніх чисел немає"); Edit5->SetFocus();return;}
if (n>100000) {ShowMessage("Дуже велике число"); Edit5->SetFocus();return;}
if (n<1210) Memo2->Lines->Add("220 та 284");
else
if (n<2924){Memo2->Lines->Add("220 та 284");
            Memo2->Lines->Add("1184 та 1210"); }
else
if (n<5564) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");}
else
if (n<6368) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");}
else
if (n<10856) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");}
else
if (n<14595) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");}
else
if (n<18416) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");
Memo2->Lines->Add("12285 та 14595");
}
else
if (n<66992) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");
Memo2->Lines->Add("12285 та 14595");
Memo2->Lines->Add("17296 та 18416");
}
else
if (n<71145) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");
Memo2->Lines->Add("12285 та 14595");
Memo2->Lines->Add("17296 та 18416");
Memo2->Lines->Add("66928 та 66992");
}
else
if (n<76084) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");
Memo2->Lines->Add("12285 та 14595");
Memo2->Lines->Add("17296 та 18416");
Memo2->Lines->Add("66928 та 66992");
Memo2->Lines->Add("67095 та 71145");}
else
if (n<87633) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");
Memo2->Lines->Add("12285 та 14595");
Memo2->Lines->Add("17296 та 18416");
Memo2->Lines->Add("66928 та 66992");
Memo2->Lines->Add("67095 та 71145");
Memo2->Lines->Add("63020 та 76084");}
else
if (n<88730) {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");
Memo2->Lines->Add("12285 та 14595");
Memo2->Lines->Add("17296 та 18416");
Memo2->Lines->Add("66928 та 66992");
Memo2->Lines->Add("67095 та 71145");
Memo2->Lines->Add("63020 та 76084");
Memo2->Lines->Add("69615 та 87633");}
else
 {Memo2->Lines->Add("220 та 284");
Memo2->Lines->Add("1184 та 1210");
Memo2->Lines->Add("2620 та 2924");
Memo2->Lines->Add("5020 та 5564");
Memo2->Lines->Add("6232 та 6368");
Memo2->Lines->Add("10744 та 10856");
Memo2->Lines->Add("12285 та 14595");
Memo2->Lines->Add("17296 та 18416");
Memo2->Lines->Add("66928 та 66992");
Memo2->Lines->Add("67095 та 71145");
Memo2->Lines->Add("63020 та 76084");
Memo2->Lines->Add("69615 та 87633");
Memo2->Lines->Add("79750 та 88730");}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button10Click(TObject *Sender)
{
  Label8->Caption="";
float a = StrToFloat(Edit6 ->Text);
if (a<0.001) {ShowMessage("Введіть коректні дані");} else

if (a<7.8)
        {  Label8->Caption="Ракета злетіла, але впала на Землю... "; MediaPlayer1->FileName="1_1.avi";MediaPlayer1->Open();MediaPlayer1->Display = Panel1;
MediaPlayer1->Play();}
  else
       if (a>=7.8 && a<11.4)
                {Label8->Caption="Ракета злетіла і стала супутником Землі.";MediaPlayer1->FileName="2_1.avi";
MediaPlayer1->Open();
MediaPlayer1->Display = Panel1;

MediaPlayer1->Play();
}
    else
        if (a>=11.4 && a<16.4)
                {Label8->Caption="Ракета злетіла і стала супутником Сонця";MediaPlayer1->FileName="2_1.avi";
MediaPlayer1->Open(); MediaPlayer1->Display = Panel1;
MediaPlayer1->Play(); }
else
        {Label8->Caption="Ракета злетіла і покинула Сонячну Систему... "; MediaPlayer1->FileName="2_1.avi";
MediaPlayer1->Open();   MediaPlayer1->Display = Panel1; 
MediaPlayer1->Play();  }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button11Click(TObject *Sender)
{
Edit6->Clear();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit6KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key=='-') Key=0;
if (Key == VK_RETURN) {Button10->SetFocus(); return;}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button12Click(TObject *Sender)
{
 switch(RadioGroup1->ItemIndex)
  {
    case 0:Edit7->Show(); Edit7->SetFocus();Edit8->Show(); Edit9->Show();Label11->Show();Label12->Show();Label13->Show();Label14->Show();break;
    case 1:Edit10->Show(); Edit10->SetFocus();Edit11->Show(); Edit12->Show();Label12->Show();Label13->Show();Label14->Show();Label15->Show();break;
    case 2:Edit13->Show(); Edit13->SetFocus();Label16->Show(); Label17->Show();break;
  }
  RadioGroup1->Hide();
  Button12->Hide();Button13->Show();Button14->Show();Button16->Show();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button13Click(TObject *Sender)
{
int x1,x2,x3,x;
float y1,y2,y3,y;
switch(RadioGroup1->ItemIndex)
{
  case 0: if(((Edit7->Text).Length()==0)||((Edit8->Text).Length()==0)||((Edit9->Text).Length()==0)) {ShowMessage("Ви не заповнили поля!"); return;}
  Edit14->Show();Label18->Show(); x1=StrToInt(Edit7->Text);x2=StrToInt(Edit8->Text);x3=StrToInt(Edit8->Text);x=NSK(x1,NSK(x2,x3)); Edit14->Text=IntToStr(x);break;
  case 1: if(((Edit10->Text).Length()==0)||((Edit11->Text).Length()==0)||((Edit12->Text).Length()==0)) {ShowMessage("Ви не заповнили поля!"); return;}
  Edit14->Show();Label18->Show(); y1=StrToInt(Edit10->Text);y2=StrToInt(Edit11->Text);y3=StrToInt(Edit12->Text);y=max(y1,max(y2,y3))+min(y1,min(y2,y3));Edit14->Text=FloatToStrF(y,ffFixed,5,2);break;
  case 2: if((Edit13->Text).Length()==0) {ShowMessage("Ви не заповнили поля!"); return;}
  Edit14->Show();Label18->Show(); y1=StrToFloat(Edit13->Text);y=6*Plosha(y1);Edit14->Text=FloatToStrF(y,ffFixed,5,2);break;
}
Button13->Hide();Label19->Show();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button14Click(TObject *Sender)
{
Edit7->Clear();Edit8->Clear();Edit9->Clear();Edit10->Clear();Edit11->Clear();Edit12->Clear();Edit13->Clear();Edit14->Clear();
Edit14->Hide();Label18->Hide();Label19->Hide(); Button13->Show();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button16Click(TObject *Sender)
{
Edit7->Clear();Edit8->Clear();Edit9->Clear();Edit10->Clear();Edit11->Clear();Edit12->Clear();Edit13->Clear();Edit14->Clear();
Edit7->Hide();Edit8->Hide();Edit9->Hide();Edit10->Hide();Edit11->Hide();Edit12->Hide();Edit13->Hide();Edit14->Hide();
Label11->Hide();Label12->Hide();Label13->Hide();Label14->Hide();Label15->Hide();Label16->Hide();Label17->Hide();Label18->Hide();Label19->Hide();
Button13->Hide();Button14->Hide();Button16->Hide();
RadioGroup1->Show();Button12->Show();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit14KeyPress(TObject *Sender, char &Key)
{
Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit7KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key)) Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit8KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key)) Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit9KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key)) Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit10KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key)) Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit11KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key)) Key=0;        
}
//---------------------------------------------------------------------------


void __fastcall TForm1::Edit12KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key)) Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit13KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key)) Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button15Click(TObject *Sender)
{
int n=StrToInt(Edit4->Text),i,j,count=0;
if (n<2) {ShowMessage("Надто малий проміжок"); return;}
Memo1->Lines->Add("Елементи:");
for (i=n;i<=2*n;i++)
   if ((i==2 || i==3 || i==5) || (i%2!=0 && i%3!=0 && i%5!=0)) {
        j=i+2;
        if (j==5 || (j%2!=0 && j%3!=0 && j%5!=0))
          if (j<=2*n) {
           Memo1->Lines->Add(IntToStr(i)+" та "+IntToStr(j));
           count++;
          }
   }
if (count==0) Memo1->Lines->Add("На проміжку немає чисел-близнят");        
}
//---------------------------------------------------------------------------


void __fastcall TForm1::Button6Click(TObject *Sender)
{
int i=0,n,digit,j,chis,c;
   j=0; c=0;
   Label23->Caption="";
   Label27->Caption="";
   Label26->Visible=false;
   Label24->Visible=false;
   Label25->Visible=false;

   n=StrToInt(Edit15->Text);
  while (n>0) {
 digit=n % 10;
   n=n / 10;
   if (digit%2==0)
   { Label23->Caption="Число містить парні числа";
   j=6;break;}  }
 if (j!=6) {
   if (digit%2!=0){
   n=StrToInt(Edit15->Text);
   while (n>0) {
 digit=n % 10;
   n=n / 10;
   i=i+digit; }
   Label24->Visible=true;
   Label25->Visible=true;
   Label25->Caption=i; }

   while (i>0) {
 chis=i % 10;
   i=i / 10;
   if (chis%2==0)
   { c=c+1;}  }
   Label27->Visible=true;
   Label27->Caption=c;
   Label26->Visible=true; }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button17Click(TObject *Sender)
{
Label23->Caption="";
   Label27->Caption="";
   Label26->Visible=false;
   Label24->Visible=false;
   Label25->Visible=false;
   Edit15->Clear();        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit15KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit16KeyPress(TObject *Sender, char &Key)
{
if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Memo3KeyPress(TObject *Sender, char &Key)
{
Key=0;        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button19Click(TObject *Sender)
{
Edit16->Clear();
Memo3->Clear();
Label29->Caption="";
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button18Click(TObject *Sender)
{
 int n,ok,h,ot,c[19];
 Memo3->Lines->Add("Числа Мерсена");
h=StrToInt(Edit16->Text);
n=19;
ok=0;
Label29->Caption=h;
for (int i=0;ok<n;i++)
  if (prv(i)<h)
   {  ot=pow(2,i)-1;
      ok++;
      c[ok]=ot;
   }
  for (int i=2;i<19;i++)
  {  if (h>=c[i])

     Memo3->Lines->Add(c[i]);
}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button21Click(TObject *Sender)
{
Edit17->Clear();
Label32->Caption="";
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Edit17KeyPress(TObject *Sender, char &Key)
{
 if (IsCharAlpha(Key) || Key=='.' || Key==',' || Key=='-') Key=0;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button20Click(TObject *Sender)
{
  int a,b;
a=StrToInt(Edit17->Text);
b= podc(a);
   Label32->Caption=b;
}
//---------------------------------------------------------------------------

Соседние файлы в папке ТПСПП_практ3
  • #
    30.05.202018.04 Кб0Project1.obj
  • #
    30.05.2020876 б0Project1.res
  • #
    30.05.20202.16 Mб0Project1.tds
  • #
    30.05.20203.7 Кб0Project1.~bpr
  • #
    30.05.20201.07 Кб0Project1.~cpp
  • #
    30.05.202022.09 Кб0Unit1.cpp
  • #
    30.05.202051 б0Unit1.ddp
  • #
    30.05.202093.71 Кб0Unit1.dfm
  • #
    30.05.20206.41 Кб0Unit1.h
  • #
    30.05.2020203.91 Кб0Unit1.obj
  • #
    30.05.202022.09 Кб0Unit1.~cpp