C/C++ tilida dasturlash




Download 1,39 Mb.
Pdf ko'rish
bet16/18
Sana13.06.2024
Hajmi1,39 Mb.
#263316
1   ...   10   11   12   13   14   15   16   17   18
 
 


39 
ILOVA 
Unit 1 
//--------------------------------------------------------------------------- 
#include  
#include  
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
bool p = 0; 
bool q = 0; 
TForm1 *Form1; 
//--------------------------------------------------------------------------- 
__fastcall TForm1::TForm1(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
void __fastcall TForm1::Button1Click(TObject *Sender) 

if(Edit1->Text == "" && Edit2->Text == ""){ 
Form2->Show(); 
Form1->Hide(); 
} else { 
ShowMessage("Login yoki parol noto'g'ri"); 




40 
//--------------------------------------------------------------------------- 
void __fastcall TForm1::Edit2Change(TObject *Sender) 

Edit2->PasswordChar = '*'; 

//--------------------------------------------------------------------------- 
void __fastcall TForm1::Edit2MouseDown(TObject *Sender, 
TMouseButton Button, TShiftState Shift, int X, int Y) 

if(p == 0){ 
Edit2->Text = ""; 
p = 1; 


//--------------------------------------------------------------------------- 
void __fastcall TForm1::Edit1MouseDown(TObject *Sender, 
TMouseButton Button, TShiftState Shift, int X, int Y) 

if(q == 0){ 
Edit1->Text = ""; 
q = 1; 


//--------------------------------------------------------------------------- 


41 
Unit 2 
//--------------------------------------------------------------------------- 
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm2 *Form2; 
//--------------------------------------------------------------------------- 
__fastcall TForm2::TForm2(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
void __fastcall TForm2::Button3Click(TObject *Sender) 

Form10->Show(); 
Form2->Hide(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm2::Button1Click(TObject *Sender) 

Form3->Show(); 
Form2->Hide(); 

//--------------------------------------------------------------------------- 


42 
void __fastcall TForm2::Button2Click(TObject *Sender) 

Form9->Show(); 
Form2->Hide(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm2::Button4Click(TObject *Sender) 

Form1->Close();

//--------------------------------------------------------------------------- 


43 
Unit 3 
//--------------------------------------------------------------------------- 
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm3 *Form3; 
//--------------------------------------------------------------------------- 
__fastcall TForm3::TForm3(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
void __fastcall TForm3::Button1Click(TObject *Sender) 

Form4->Show(); 
Form3->Hide(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm3::Button6Click(TObject *Sender) 

Form2->Show(); 
Form3->Close(); 

//--------------------------------------------------------------------------- 


44 
void __fastcall TForm3::Button2Click(TObject *Sender) 

Form5->Show(); 
Form3->Hide(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm3::Button3Click(TObject *Sender) 

Form6->Show(); 
Form3->Hide(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm3::Button4Click(TObject *Sender) 

Form7->Show(); 
Form3->Hide(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm3::Button5Click(TObject *Sender) 

Form8->Show(); 
Form3->Hide(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm3::Button7Click(TObject *Sender) 

Form1->Close();

//--------------------------------------------------------------------------- 


45 
Unit 4 
//--------------------------------------------------------------------------- 
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm4 *Form4; 
//--------------------------------------------------------------------------- 
__fastcall TForm4::TForm4(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
int t = 1; 
void __fastcall TForm4::Button1Click(TObject *Sender) 

t = 1; 
Image1->Visible = true; 
Image2->Visible = false; 
Image3->Visible = false; 
Image4->Visible = false; 
Image5->Visible = false; 
Image6->Visible = false; 
Button2->Enabled = false; 
Button3->Enabled = true; 
Form4->Close(); 
Form3->Show(); 

//--------------------------------------------------------------------------- 


46 
void __fastcall TForm4::Button2Click(TObject *Sender) 

if(t == 2) 

Image1->Visible = true; 
Image2->Visible = false; 
Button2->Enabled = false; 

if(t == 3) 

Image2->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image3->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image4->Visible = true; 
Image5->Visible = false; 

if(t == 6) 

Image5->Visible = true; 
Image6->Visible = false; 
Button3->Enabled = true; 

t --; 

//--------------------------------------------------------------------------- 
void __fastcall TForm4::Button3Click(TObject *Sender) 

if(t == 1) 

Image2->Visible = true; 
Image1->Visible = false; 
Button2->Enabled = true; 

if(t == 2) 



47 
Image3->Visible = true; 
Image2->Visible = false; 

if(t == 3) 

Image4->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image5->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image6->Visible = true; 
Image5->Visible = false; 
Button3->Enabled = false; 

t ++; 

//--------------------------------------------------------------------------- 
void __fastcall TForm4::Button4Click(TObject *Sender) 

Form1->Close(); 

//--------------------------------------------------------------------------- 


48 
Unit 5 
//--------------------------------------------------------------------------- 
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm5 *Form5; 
//--------------------------------------------------------------------------- 
__fastcall TForm5::TForm5(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
int t = 1; 
void __fastcall TForm5::Button1Click(TObject *Sender) 

t = 1; 
Image1->Visible = true; 
Image2->Visible = false; 
Image3->Visible = false; 
Image4->Visible = false; 
Image5->Visible = false; 
Image6->Visible = false; 
Image7->Visible = false; 
Button2->Enabled = false; 
Button3->Enabled = true; 
Form5->Close(); 


49 
Form3->Show(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm5::Button4Click(TObject *Sender) 

Form1->Close(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm5::Button2Click(TObject *Sender) 

if(t == 2) 

Image1->Visible = true; 
Image2->Visible = false; 
Button2->Enabled = false; 

if(t == 3) 

Image2->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image3->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image4->Visible = true; 
Image5->Visible = false; 

if(t == 6) 

Image5->Visible = true; 
Image6->Visible = false; 

if(t == 7) 

Image6->Visible = true; 
Image7->Visible = false; 
Button3->Enabled = true; 

t --; 


50 

//--------------------------------------------------------------------------- 
void __fastcall TForm5::Button3Click(TObject *Sender) 

if(t == 1) 

Image2->Visible = true; 
Image1->Visible = false; 
Button2->Enabled = true; 

if(t == 2) 

Image3->Visible = true; 
Image2->Visible = false; 

if(t == 3) 

Image4->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image5->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image6->Visible = true; 
Image5->Visible = false; 

if(t == 6) 

Image7->Visible = true; 
Image6->Visible = false; 
Button3->Enabled = false; 

t ++; 

//--------------------------------------------------------------------------- 


51 
Unit 6 
//--------------------------------------------------------------------------- 
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm6 *Form6; 
//--------------------------------------------------------------------------- 
__fastcall TForm6::TForm6(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
int t = 1; 
void __fastcall TForm6::Button1Click(TObject *Sender) 

t = 1; 
Image1->Visible = true; 
Image2->Visible = false; 
Image3->Visible = false; 
Image4->Visible = false; 
Image5->Visible = false; 
Image6->Visible = false; 
Button2->Enabled = false; 
Button3->Enabled = true; 
Form6->Close(); 
Form3->Show(); 


52 

//--------------------------------------------------------------------------- 
void __fastcall TForm6::Button4Click(TObject *Sender) 

Form1->Close(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm6::Button2Click(TObject *Sender) 

if(t == 2) 

Image1->Visible = true; 
Image2->Visible = false; 
Button2->Enabled = false; 

if(t == 3) 

Image2->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image3->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image4->Visible = true; 
Image5->Visible = false; 

if(t == 6) 

Image5->Visible = true; 
Image6->Visible = false; 
Button3->Enabled = true; 

t --; 

//--------------------------------------------------------------------------- 
void __fastcall TForm6::Button3Click(TObject *Sender) 

if(t == 1) 


53 

Image2->Visible = true; 
Image1->Visible = false; 
Button2->Enabled = true; 

if(t == 2) 

Image3->Visible = true; 
Image2->Visible = false; 

if(t == 3) 

Image4->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image5->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image6->Visible = true; 
Image5->Visible = false; 
Button3->Enabled = false; 

t ++;

//--------------------------------------------------------------------------- 


54 
Unit 7 
//--------------------------------------------------------------------------- 
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm7 *Form7; 
//--------------------------------------------------------------------------- 
__fastcall TForm7::TForm7(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
int t = 1; 
void __fastcall TForm7::Button1Click(TObject *Sender) 

t = 1; 
Image1->Visible = true; 
Image2->Visible = false; 
Image3->Visible = false; 
Image4->Visible = false; 
Image5->Visible = false; 
Image6->Visible = false; 
Image7->Visible = false; 
Button2->Enabled = false; 
Button3->Enabled = true; 
Form7->Close(); 
Form3->Show(); 



55 
//--------------------------------------------------------------------------- 
void __fastcall TForm7::Button4Click(TObject *Sender) 

Form1->Close(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm7::Button2Click(TObject *Sender) 

if(t == 2) 

Image1->Visible = true; 
Image2->Visible = false; 
Button2->Enabled = false; 

if(t == 3) 

Image2->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image3->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image4->Visible = true; 
Image5->Visible = false; 

if(t == 6) 

Image5->Visible = true; 
Image6->Visible = false; 

if(t == 7) 

Image6->Visible = true; 
Image7->Visible = false; 
Button3->Enabled = true; 

t --; 


56 

//--------------------------------------------------------------------------- 
void __fastcall TForm7::Button3Click(TObject *Sender) 

if(t == 1) 

Image2->Visible = true; 
Image1->Visible = false; 
Button2->Enabled = true; 

if(t == 2) 

Image3->Visible = true; 
Image2->Visible = false; 

if(t == 3) 

Image4->Visible = true; 
Image3->Visible = false; 

if(t == 4) 

Image5->Visible = true; 
Image4->Visible = false; 

if(t == 5) 

Image6->Visible = true; 
Image5->Visible = false; 

if(t == 6) 

Image7->Visible = true; 
Image6->Visible = false; 
Button3->Enabled = false; 

t ++; 

//--------------------------------------------------------------------------- 


57 
Unit 8 
//--------------------------------------------------------------------------- 
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm8 *Form8; 
//--------------------------------------------------------------------------- 
__fastcall TForm8::TForm8(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
int t = 1; 
void __fastcall TForm8::Button1Click(TObject *Sender) 

t = 1; 
Image1->Visible = true; 
Image2->Visible = false; 
Button2->Enabled = false; 
Button3->Enabled = true; 
Form8->Close(); 
Form3->Show(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm8::Button4Click(TObject *Sender) 


58 

Form1->Close(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm8::Button2Click(TObject *Sender) 

if(t == 2) 

Image1->Visible = true; 
Image2->Visible = false; 
Button2->Enabled = false; 
Button3->Enabled = true; 

t --; 

//--------------------------------------------------------------------------- 
void __fastcall TForm8::Button3Click(TObject *Sender) 

if(t == 1) 

Image2->Visible = true; 
Image1->Visible = false; 
Button2->Enabled = true; 
Button3->Enabled = false; 

t ++; 

//--------------------------------------------------------------------------- 


59 
Unit 9 
//--------------------------------------------------------------------------- 
#include  
#include  
#include  
#include  
#pragma hdrstop 
#include "Unit1.h" 
#include "Unit2.h" 
#include "Unit3.h" 
#include "Unit4.h" 
#include "Unit5.h" 
#include "Unit6.h" 
#include "Unit7.h" 
#include "Unit8.h" 
#include "Unit9.h" 
#include "Unit10.h" 
#include "Unit11.h" 
#include "Unit12.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm9 *Form9; 
//--------------------------------------------------------------------------- 
__fastcall TForm9::TForm9(TComponent* Owner) 
: TForm(Owner) 


//--------------------------------------------------------------------------- 
void __fastcall TForm9::Button2Click(TObject *Sender) 

Form2->Show(); 
Form9->Close(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm9::Button4Click(TObject *Sender) 

Form1->Close(); 

//--------------------------------------------------------------------------- 
void __fastcall TForm9::Button3Click(TObject *Sender) 

Edit1->Text = ""; 
Edit2->Text = ""; 


60 
Edit3->Text = ""; 
Edit4->Text = ""; 

//--------------------------------------------------------------------------- 
void __fastcall TForm9::Button1Click(TObject *Sender) 

string S1, S2, s3, RES; 
string a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
__int64 s1 = 0, s2 = 0; 
double res2 = 0; 
S1 = Edit1->Text.c_str(); S2 = Edit2->Text.c_str(); s3 = Edit3-
>Text.c_str(); 
__int64 len1 = S1.size(); __int64 len2 = S2.size(); __int64 len3 = 
s3.size(); 
for(int i = 0; i < len1; ++ i){ 
if('0' > S1[i] || S1[i] > '9'){ 
s1 = -1; 
break; 

s1 = s1 * 10 + (S1[i] - '0'); 

if(2 > s1 || s1 > 36){ 
ShowMessage("1-sanoq sistemasi xato kiritilgan !"); 
return ; 

for(int i = 0; i < len2; ++ i){ 
if('0' > S2[i] && S2[i] > '9'){ 
s2 = -1; 
break; 

s2 = s2 * 10 + (S2[i] - '0'); 

if(2 > s2 || s2 > 36){ 
ShowMessage("2-sanoq sistemasi xato kiritilgan !"); 
return ; 

int q = 0; 
if(s3 == ""){ 
ShowMessage("Son xato kiritilgan !"); 
return ; 

for(int i = 0; i < len3; ++ i){ 
if(s3[i] == '.' || s3[i] == ',') q ++; 
if((s3[i] != '.' && s3[i] != ',') && (q > 1 || s3[i] < 48 || s3[i] > 90 || 
(s3[i] < 65 ? s3[i] - '0' : s3[i] - 'A' + 10) >= s1)){ 
ShowMessage("Son xato kiritilgan !"); 
return ; 


61 


__int64 res1 = 0, ind = len3; 
for(__int64 i = 0; i < len3; ++ i){ 
if(s3[i] == '.' || s3[i] == ','){ 
ind = i; 
break; 


__int64 k = 1; 
for(__int64 i = ind - 1; i >= 0; -- i){ 
res1 = res1 + (s3[i] < 65 ? s3[i] - '0' : s3[i] - 'A' + 10) * k; 
k = k * s1; 
if(k > 1000000000000000){ 
ShowMessage("Son juda katta iltimos kichikroq son kiriting !"); 
return ; 


while(res1 > 0){ 
RES = a[res1 % s2] + RES; 
res1 = res1 / s2; 

if(RES == "") RES = "0"; 
RES = RES + '.'; 
double p = 1.0 / s1; 
for(int i = ind + 1; i < len3; ++ i){ 
res2 = res2 + (s3[i] < 65 ? s3[i] - '0' : s3[i] - 'A' + 10) * p; 
p = p / s1; 
if(p < 0.0000000000000001){ 
ShowMessage("Sonning kasr qismi juda uzun iltimos kasr qismni 
kamaytiring !"); 
return ; 


k = 0; 
while(k < 10 && res2 != 0){ 
res2 = res2 * s2; 
RES = RES + a[int(res2)]; 
res2 = res2 - int(res2); 
k ++; 

if(RES[RES.size() - 1] == '.') RES.erase(RES.end() - 1); 
Edit4->Text = RES.c_str(); 



62 

Download 1,39 Mb.
1   ...   10   11   12   13   14   15   16   17   18




Download 1,39 Mb.
Pdf ko'rish