Programlama | Programlama Dilleri | C Programlama Dili |C++

Hata
  • XML Parsing Error at 1:82. Error 9: Invalid character
Anasayfa Programlama C++ Builder Lig (Puan Durumu)


Lig (Puan Durumu)

AÇIKLAMA

C++ Builder 2009  projesidir.

Öncelikli olarak Tak?m Gir k?sm?ndan lige kaç adet tak?m girilecekse eklenmelidir.Tak?m ekleme i?lemi bittikten sonra eklenmi? listeden bir tak?m seçilip Skor Gir butonuna t?klan?r. ?ki tak?m aras?ndaki maç?n skoru girilir. Buna istinaden olu?an puan durumu an?nda yans?t?l?r.

Program?n Tamam?n? A?a??daki Linkten ?ndirebilirsiniz

Linki Görebilmeniz ?çin Üye Olman?z Gerekmektedir...

Üye Kay?t

Program Kodu:

Unit1.cpp

  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5.  
  6. #include "Unit1.h"
  7. #include "Unit2.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma resource "*.dfm"
  11. TForm1 *Form1;
  12. int kontrol=0;
  13. //---------------------------------------------------------------------------
  14. __fastcall TForm1::TForm1(TComponent* Owner)
  15.     : TForm(Owner)
  16. {
  17. }
  18. //---------------------------------------------------------------------------
  19. void __fastcall TForm1::Button1Click(TObject *Sender)
  20. {
  21. if(Edit1->Text!="")
  22. {
  23. ListBox1->Items->Add(Edit1->Text);
  24. Edit1->Text="";
  25. }
  26. }
  27. //---------------------------------------------------------------------------
  28. void __fastcall TForm1::Button2Click(TObject *Sender)
  29. {
  30.  
  31. if(kontrol==0)
  32. {
  33. for(int i=0;i<ListBox1->Items->Count;i++)
  34. {
  35. ListBox2->Items->Add("0");
  36. ListBox3->Items->Add("0");
  37. }
  38. kontrol=1;
  39. }
  40. int x=ListBox1->ItemIndex;
  41. if(x<0)
  42. Application->MessageBox(L"1.Tak?m? Seçiniz",L"UYARI",MB_ICONINFORMATION) ;
  43. else
  44. {
  45.  Form2->ListBox1->Items->Clear();
  46.  Form2->Show();
  47.  for(int p=0;p<ListBox1->Items->Count;p++)
  48.  {
  49.  if(p!=x)
  50.  Form2->ListBox1->Items->Add(ListBox1->Items->Strings[p]);
  51.  }
  52.  Label1->Visible=false;
  53. Edit1->Visible=false;
  54. Button1->Visible=false;
  55. }
  56. }
  57.  
  58. //---------------------------------------------------------------------------
  59. void __fastcall TForm1::Edit1KeyPress(TObject *Sender, wchar_t &Key)
  60. {
  61. if(Key==L'?' || Key==L'?')
  62. Key=L'?';
  63. else if(Key==L'Ü' || Key==L'ü')
  64. Key=L'Ü';
  65. else if(Key==L'?' || Key==L'?')
  66. Key=L'?';
  67. else if(Key==L'?' || Key==L'i')
  68. Key=L'?';
  69. else if(Key==L'Ö' || Key==L'ö')
  70. Key=L'Ö';
  71. else if(Key==L'?' || Key==L'?')
  72. Key=L'?';
  73. else if(Key==L'Ç' || Key==L'ç')
  74. Key=L'Ç';
  75. else if((UpCase(Key)<L'A'|| UpCase(Key)>L'Z')&& Key!=VK_DELETE && Key!=VK_BACK )
  76. Key=0;
  77. }
  78. //---------------------------------------------------------------------------
  79.  
  80.  

 

Unit2.cpp

  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5. #include "Unit1.h"
  6. #include "Unit2.h"
  7. //---------------------------------------------------------------------------
  8. #pragma package(smart_init)
  9. #pragma resource "*.dfm"
  10. TForm2 *Form2;
  11. //---------------------------------------------------------------------------
  12. __fastcall TForm2::TForm2(TComponent* Owner)
  13.     : TForm(Owner)
  14. {
  15. }
  16. //---------------------------------------------------------------------------
  17. void __fastcall TForm2::Button1Click(TObject *Sender)
  18. {
  19. int x=ListBox1->ItemIndex;
  20. if(x<0)
  21. Application->MessageBox(L"2.Tak?m? Seçiniz",L"UYARI",MB_ICONINFORMATION) ;
  22. else
  23. {
  24.  String yazdir=Form1->ListBox1->Items->Strings[Form1->ListBox1->ItemIndex]+" ile "+Form2->ListBox1->Items->Strings[Form2->ListBox1->ItemIndex]+" Aras?ndaki Oynanan Maç?n Skorunu Giriniz";
  25.  String skor=InputBox(L"SKOR G?R",yazdir.t_str(),"0-0");
  26.  char dizi[3];
  27.  strcpy(dizi,skor.t_str());
  28.  int skor1=StrToInt(dizi[0]);
  29.  int skor2=StrToInt(dizi[2]);
  30.  int averaj;
  31.  
  32.  int sira1=Form1->ListBox1->ItemIndex;
  33.  int sira2;
  34.  int puan;
  35.  
  36.  for(int z=0;z<Form1->ListBox1->Items->Count;z++)
  37.  {
  38.      if(Form2->ListBox1->Items->Strings[Form2->ListBox1->ItemIndex]==Form1->ListBox1->Items->Strings[z])
  39.      sira2=z;
  40.  }
  41.  
  42.  if(skor1>skor2)
  43.  {
  44.    puan=StrToInt(Form1->ListBox2->Items->Strings[sira1]);
  45.    puan+=3;
  46.    Form1->ListBox2->Items->Strings[sira1]=IntToStr(puan);
  47.    averaj=StrToInt(Form1->ListBox3->Items->Strings[sira1]);
  48.    averaj+=(skor1-skor2);
  49.    Form1->ListBox3->Items->Strings[sira1]=IntToStr(averaj);
  50.    averaj=StrToInt(Form1->ListBox3->Items->Strings[sira2]);
  51.    averaj-=(skor1-skor2);
  52.    Form1->ListBox3->Items->Strings[sira2]=IntToStr(averaj);
  53.  }
  54.  if(skor2>skor1)
  55.  {
  56.  
  57.    puan=StrToInt(Form1->ListBox2->Items->Strings[sira2]);
  58.    puan+=3;
  59.    Form1->ListBox2->Items->Strings[sira2]=IntToStr(puan);
  60.    averaj=StrToInt(Form1->ListBox3->Items->Strings[sira2]);
  61.    averaj+=(skor2-skor1);
  62.    Form1->ListBox3->Items->Strings[sira2]=IntToStr(averaj);
  63.    averaj=StrToInt(Form1->ListBox3->Items->Strings[sira1]);
  64.    averaj-=(skor2-skor1);
  65.    Form1->ListBox3->Items->Strings[sira1]=IntToStr(averaj);
  66.  }
  67.  if(skor1==skor2)
  68.  {
  69.    puan=StrToInt(Form1->ListBox2->Items->Strings[sira1]);
  70.    puan+=1;
  71.    Form1->ListBox2->Items->Strings[sira1]=IntToStr(puan);
  72.    puan=StrToInt(Form1->ListBox2->Items->Strings[sira2]);
  73.    puan+=1;
  74.    Form1->ListBox2->Items->Strings[sira2]=IntToStr(puan);
  75.  }
  76.  
  77.  
  78.  
  79. }
  80. Form1->ListBox4->Items->Clear();
  81. Form1->ListBox5->Items->Clear();
  82. Form1->ListBox6->Items->Clear();
  83. Form1->ListBox7->Items->Clear();
  84. Form1->ListBox8->Items->Clear();
  85. Form1->ListBox9->Items->Clear();
  86.  
  87. for(int l=0;l<Form1->ListBox1->Items->Count;l++)
  88. Form1->ListBox7->Items->Add(Form1->ListBox1->Items->Strings[l]);
  89. for(int l=0;l<Form1->ListBox2->Items->Count;l++)
  90. Form1->ListBox5->Items->Add(Form1->ListBox2->Items->Strings[l]);
  91. for(int l=0;l<Form1->ListBox3->Items->Count;l++)
  92. Form1->ListBox6->Items->Add(Form1->ListBox3->Items->Strings[l]);
  93.  
  94. for(int p=0;p<Form1->ListBox2->Items->Count;p++)
  95. {
  96.     for(int k=p+1;k<Form1->ListBox5->Items->Count;k++)
  97.     {
  98.         if(StrToInt(Form1->ListBox5->Items->Strings[p])<StrToInt(Form1->ListBox5->Items->Strings[k]))
  99.         {
  100.             String temp=Form1->ListBox5->Items->Strings[p];
  101.             Form1->ListBox5->Items->Strings[p]=Form1->ListBox5->Items->Strings[k];
  102.             Form1->ListBox5->Items->Strings[k]=temp;
  103.             String temp2=Form1->ListBox6->Items->Strings[p];
  104.             Form1->ListBox6->Items->Strings[p]=Form1->ListBox6->Items->Strings[k];
  105.             Form1->ListBox6->Items->Strings[k]=temp2;
  106.             String temp3=Form1->ListBox7->Items->Strings[p];
  107.             Form1->ListBox7->Items->Strings[p]=Form1->ListBox7->Items->Strings[k];
  108.             Form1->ListBox7->Items->Strings[k]=temp3;
  109.         }
  110.     }
  111. }
  112.  
  113. for(int p=0;p<Form1->ListBox5->Items->Count;p++)
  114. {
  115.     for(int k=p+1;k<Form1->ListBox5->Items->Count;k++)
  116.     {
  117.        if(Form1->ListBox5->Items->Strings[p]==Form1->ListBox5->Items->Strings[k])
  118.        {
  119.            if(StrToInt(Form1->ListBox6->Items->Strings[p])<StrToInt(Form1->ListBox6->Items->Strings[k]))
  120.            {
  121.             String temp=Form1->ListBox6->Items->Strings[p];
  122.             Form1->ListBox6->Items->Strings[p]=Form1->ListBox6->Items->Strings[k];
  123.             Form1->ListBox6->Items->Strings[k]=temp;
  124.             String temp1=Form1->ListBox7->Items->Strings[p];
  125.             Form1->ListBox7->Items->Strings[p]=Form1->ListBox7->Items->Strings[k];
  126.             Form1->ListBox7->Items->Strings[k]=temp1;
  127.            }
  128.        }
  129.  
  130.     }
  131. }
  132.  
  133. for(int i=0;i<Form1->ListBox1->Items->Count;i++)
  134. {
  135.  
  136.   String yazdir=Form1->ListBox7->Items->Strings[i];
  137.   Form1->ListBox4->Items->Add(yazdir) ;
  138.   yazdir=Form1->ListBox5->Items->Strings[i];
  139.   Form1->ListBox8->Items->Add(yazdir) ;
  140.   yazdir=Form1->ListBox6->Items->Strings[i];
  141.   Form1->ListBox9->Items->Add(yazdir) ;
  142.  
  143. }
  144.  
  145.  Form2->Close();
  146.  Form1->Show();
  147. }
  148. //---------------------------------------------------------------------------
  149.  

Yorumlar (0)
Sadece kayıtlı kullanıcılar yorum yazabilir!
Son Güncelleme ( Salı, 04 Eylül 2012 03:12 )  
404 Not Found

404

Not Found

The resource requested could not be found on this server!


Proudly powered by LiteSpeed Web Server

Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.