justify"> # include Unit5.h
# include Unit1.h
# include Unit9.h
//---------------------------------------------------------------------------
# pragma package (smart_init)
# pragma link CSPIN
# pragma resource *. dfm * Form5;
//---------------------------------------------------------------------------
__ fastcall TForm5 :: TForm5 (TComponent * Owner)
: TForm (Owner)
{
}
//---------------------------------------------------------------------------__fastcall TForm5 :: Button2Click (TObject * Sender)
{
Close ();
}
//---------------------------------------------------------------------------__fastcall TForm5 :: Button1Click (TObject * Sender)
{
int n=CSpinEdit1- gt; Value;
int h=CSpinEdit2- gt; Value;
//генератор завдань
n=h/n + kof;
n=n * n * n;
n=n/kof;
n=n + h;
n=n% var + 1;
if (FileExists ( Завдання// + IntToStr (n) + .z )) {
file_read ( Завдання// + IntToStr (n) + .z );
Form1- gt; Memo1- gt; Text=Form9- gt; Memo1- gt; Text;
Close ();
}
else
ShowMessage ( такий варіант не знайдений );
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
Лістинг файлу Unit6.cpp
//---------------------------------------------------------------------------
# include lt; vcl.h gt;
# pragma hdrstop
# include Unit6.h
# include Unit1.h
# include Unit2.h
# include Unit9.h
//---------------------------------------------------------------------------
# pragma package (smart_init)
# pragma resource *. dfm * Form6;
//---------------------------------------------------------------------------
__ fastcall TForm6 :: TForm6 (TComponent * Owner)
: TForm (Owner)
{
}
//--------------------------------------------------------------------------- ()
{
String s1=Form6- gt; Edit1- gt; Text;
String s2=Form6- gt; Edit2- gt; Text;
String s3=Form6- gt; Edit3- gt; Text;
String s4=Form6- gt; Edit4- gt; Text;
if (s1 == || s2 == || s3 == || s4 == ) return 4;// є порожні поля
for (int i=1; i lt;=s1.Length (); i ++)
if (s1 [i] lt; 0 || s1 [i] gt; 9 ) return 1;// несумісний тип даних
for (int i=1; i lt;=s3.Length (); i ++)
if (s3 [i] lt; 0 || s3 [i] gt; 9 ) return 1;// несумісний тип динних
if (s1.Length () gt; 4 || s3.Length () gt; 9) return 2;// недопутімо велике число
if (StrToInt (s1) lt; 0 || StrToInt (s3) lt; 0) return 3;// неприпустимо мале число
return 0;
}
//---------------------------------------------------------------------------__fastcall TForm6 :: Button2Click (TObject * Sender)
{
Edit1- gt; Text= 0 raquo ;;
Edit2- gt; Text= raquo ;;
Edit3- gt; Text= 0 raquo ;;
Edit4- gt; Text= raquo ;;
Close ();
}
//---------------------------------------------------------------------------__fastcall TForm6 :: Button1Click (TObject * Sender)
{
switch (protect ()) {
case 1: ShowMessage ( несумісний тип даних ); break;
case 2: ShowMessage ...