ΠΠΏΠΈΡ Π°Π»Π³ΠΎΡΠΈΡΠΌΡ.
ΠΡΠ½ΠΎΠ²ΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΡΠ²Π°Π½Π½Ρ ΡΠ° Π°Π»Π³ΠΎΡΠΈΡΠΌΡΡΠ½Ρ ΠΌΠΎΠ²ΠΈ
Memo1→Lines→Add (CheckBox8→Caption+": «); Memo1→Lines→Add (CheckBox8→Caption+»: «); If (CheckBox9→Checked==true){ int h=1;int y; If (CheckBox9→Checked==true){ int h=1;int y; If (CheckBox8→Checked==true){ int h=1;int y; If (CheckBox8→Checked==true){ int h=1;int y; If (CheckBox1→Checked==true){ double summ=0; If (CheckBox1→Checked==true){ double summ=0… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
ΠΠΏΠΈΡ Π°Π»Π³ΠΎΡΠΈΡΠΌΡ. ΠΡΠ½ΠΎΠ²ΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΡΠ²Π°Π½Π½Ρ ΡΠ° Π°Π»Π³ΠΎΡΠΈΡΠΌΡΡΠ½Ρ ΠΌΠΎΠ²ΠΈ (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
ΠΡΡΡΠΈΠ½Π³ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΈ.
//—————————————————————————————————————;
#include.
#pragma hdrstop.
#include.
#include.
#include «Unit1.h» .
#include «Unit3.h» .
#include «Unit4.h» .
#include «Unit5.h» .
//—————————————————————————————————————;
#pragma package (smart_init).
#pragma resource «*.dfm» .
TForm1 *Form1;
double a[100];
int i=1;
//—————————————————————————————————————;
__fastcall TForm1: TForm1(TComponent* Owner).
: TForm (Owner).
{.
}.
//—————————————————————————————————————;
void __fastcall TForm1: Button1Click (TObject *Sender).
{.
/*char * c = Edit1->Text.c_str ();
String b=Edit1->Text;
char str[] = c;
char delims[] = «#» ;
char *result = NULL;
result = strtok (str, delims);
while (result ≠ NULL) {.
// printf («result is «%s» «, result);
result = strtok (NULL, delims);
Memo1->Lines->Add (result);
}.
*/.
/* Edit1->Text+=" «;
int string_len = Edit1->Text.Length ();
char *string = new char[string_len];
memset (string, 0, string_len);
string = Edit1->Text.c_str ();
Memo1->Lines->Add (AnsiString (string));
Memo1->Lines->Add (string); */.
int string_len = Edit1->Text.Length ();
String b=Edit1->Text;
char *str = new char[string_len];
memset (str, 0, string_len);
str = Edit1->Text.c_str ();
char delims[] = «+» ;
char *result = NULL;
result = strtok (str, delims);
while (result ≠ NULL) {.
// printf («result is «%s» «, result);
result = strtok (NULL, delims);
Memo1->Lines->Add (result);
}.
}.
//—————————————————————————————————————;
/*double insertSort (double t[], size_t length) {.
int k, l, value;
for (k = 1; k < length; k++) {.
value = a[i];
for (l = k — 1; l >= 0 && t[l] > value; l—) {.
t[l + 1] = t[l];
}.
t[l + 1] = value;
}.
} */.
void __fastcall TForm1: Button2Click (TObject *Sender).
{.
Edit3->Text=Edit3->Text+Edit2->Text+" | «;
a[i]=StrToFloat (Edit2->Text);
i++;
}.
//—————————————————————————————————————;
void __fastcall TForm1: Button3Click (TObject *Sender).
{.
if (CheckBox1->Checked==true){ double summ=0;
int h=1;
while (h.
summ=summ+a[h];
h=h+1;
}.
summ=summ/i;
Memo1->Lines->Add (CheckBox1->Caption+" - «+ FloatToStr (summ));
}.
if (CheckBox2->Checked==true){.
double min=a[1];
int h=1;
while (h.
if (a[h]
h=h+1;
}
Memo1->Lines->Add (CheckBox2->Caption+" - «+ FloatToStr (min));
}
if (CheckBox3->Checked==true){
double max=a[1];
int h=1;
while (h
if (a[h]>max){max=a[h]; }
h=h+1;
}
Memo1->Lines->Add (CheckBox3->Caption+" - «+ FloatToStr (max));
}
if (CheckBox4->Checked==true){
int h, y; bool check=false;
while (h
check=false;
for (int t=2; t==a[h]-1; t++){
y = static_cast (a[h]);
if (y%t==0){check=true; break;}
}
if (check==false){Memo1->Lines->Add (FloatToStr (a[h]));}
h++;
}
}
if (CheckBox5->Checked==true){
double fel=i/2;
int y = static_cast (fel);
Memo1->Lines->Add (CheckBox5->Caption+" - «+ FloatToStr (a[y]));
}
if (CheckBox8->Checked==true){ int h=1;int y;
Memo1->Lines->Add (CheckBox8->Caption+": «);
while (h
y = static_cast (a[h]);
if (y%2==0){Memo1->Text=Memo1->Text+FloatToStr (a[h])+"; «;}
h=h+1;
}
}
if (CheckBox9->Checked==true){ int h=1;int y;
Memo1->Lines->Add (CheckBox9->Caption+": «);
while (h
y = static_cast (a[h]);
if (y%2≠0){Memo1->Text=Memo1->Text+FloatToStr (a[h])+"; «;}
h=h+1;
}
}
if (CheckBox10->Checked==true){
int h=1; int summ=0;
while (h
summ=summ+a[h];
h=h+1;
}
Memo1->Lines->Add (CheckBox10->Caption+" - «+ FloatToStr (summ));}
if (CheckBox11->Checked==true){int h=1; int summ=1;
while (h
summ=summ*a[h];
h=h+1;
}
Memo1->Lines->Add (CheckBox11->Caption+" - «+ FloatToStr (summ));}
if (CheckBox14->Checked==true){ Memo1->Lines->Add (CheckBox14->Caption+": «);
int h=i-1; int summ=0;
while (h≠0){
Memo1->Text=Memo1->Text+FloatToStr (a[h])+"; «;
h=h-1;
}
}
}
//—————————————————————————————————————;
void __fastcall TForm1: N1Click (TObject *Sender)
{
if (CheckBox1->Checked==true){ double summ=0;
int h=1;
while (h
summ=summ+a[h];
h=h+1;
}
summ=summ/i;
Memo1->Lines->Add (CheckBox1->Caption+" - «+ FloatToStr (summ));
}
if (CheckBox2->Checked==true){
double min=a[1];
int h=1;
while (h
if (a[h]
h=h+1;
}
Memo1->Lines->Add (CheckBox2->Caption+" - «+ FloatToStr (min));
}
if (CheckBox3->Checked==true){
double max=a[1];
int h=1;
while (h
if (a[h]>max){max=a[h]; }
h=h+1;
}
Memo1->Lines->Add (CheckBox3->Caption+" - «+ FloatToStr (max));
}
if (CheckBox4->Checked==true){
int h, y; bool check=false;
while (h
check=false;
for (int t=2; t==a[h]-1; t++){
y = static_cast (a[h]);
if (y%t==0){check=true; break;}
}
if (check==false){Memo1->Lines->Add (FloatToStr (a[h]));}
h++;
}
}
if (CheckBox5->Checked==true){
double fel=i/2;
int y = static_cast (fel);
Memo1->Lines->Add (CheckBox5->Caption+" - «+ FloatToStr (a[y]));
}
if (CheckBox8->Checked==true){ int h=1;int y;
Memo1->Lines->Add (CheckBox8->Caption+": «);
while (h
y = static_cast (a[h]);
if (y%2==0){Memo1->Text=Memo1->Text+FloatToStr (a[h])+"; «;}
h=h+1;
}
}
if (CheckBox9->Checked==true){ int h=1;int y;
Memo1->Lines->Add (CheckBox9->Caption+": «);
while (h
y = static_cast (a[h]);
if (y%2≠0){Memo1->Text=Memo1->Text+FloatToStr (a[h])+"; «;}
h=h+1;
}
}
if (CheckBox10->Checked==true){
int h=1; int summ=0;
while (h
summ=summ+a[h];
h=h+1;
}
Memo1->Lines->Add (CheckBox10->Caption+" - «+ FloatToStr (summ));}
if (CheckBox11->Checked==true){int h=1; int summ=1;
while (h
summ=summ*a[h];
h=h+1;
}
Memo1->Lines->Add (CheckBox11->Caption+" - «+ FloatToStr (summ));}
if (CheckBox14->Checked==true){ Memo1->Lines->Add (CheckBox14->Caption+": «);
int h=i-1; int summ=0;
while (h≠0){
Memo1->Text=Memo1->Text+FloatToStr (a[h])+"; «;
h=h-1;
}
}
}
//—————————————————————————————————————;
void __fastcall TForm1: N2Click (TObject *Sender)
{
Memo1->Clear ();
Edit1->Clear ();
Edit2->Clear ();
Edit3->Clear ();
}
//—————————————————————————————————————;
void __fastcall TForm1: sl1Click (TObject *Sender)
{
Form1->Close ();
}
//—————————————————————————————————————;
void __fastcall TForm1: r1Click (TObject *Sender)
{
AboutBox->Show ();
}
//—————————————————————————————————————;
void __fastcall TForm1: N4Click (TObject *Sender)
{
PagesDlg->Show ();
}
//—————————————————————————————————————;