IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası
  sohbet

 Kayıt ol  Topluluk
Yeni Konu aç Cevapla
 
LinkBack Seçenekler Stil
Alt 11 Temmuz 2014, 10:29   #1
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
N Elemanlı Bir Kümenin R Elemanlı Alt Kümelerinin Gösterimi




Girilen elemanlara ait istenilen elemandan oluşan alt kümeleri ve sayısını kullancıya gösteren programdır. Girilen elemanların aynı olup olmadığıda kontrol edilmiştir.

Kod:   Kodu kopyalamak için üzerine çift tıklayın!
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { ListBox1->Items->Add(Edit1->Text); Edit1->Text=""; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { ListBox2->Items->Clear(); ListBox3->Items->Clear(); ListBox4->Items->Clear(); String of=InputBox("GİRİŞ","Bulmak İstediğiniz Alt Kümelere Ait Eleman Sayısını Giriniz",""); int altkume=StrToInt(of); Application->MessageBox("Öncelikli Olarak Aynı Elemanların Eleminasyonu Kontrolü","UYARI",MB_ICONINFORMATION); for(int i=0;i<ListBox1->Items->Count;i++) { for(int j=i+1;j<ListBox1->Items->Count;j++) { if(ListBox1->Items->Strings[i]==ListBox1->Items->Strings[j]) ListBox1->Items->Delete(j); } } for(int i=0;i<ListBox1->Items->Count;i++) { for(int j=i+1;j<ListBox1->Items->Count;j++) { String olustur=ListBox1->Items->Strings[i]+","+ListBox1->Items->Strings[j]; ListBox3->Items->Add(olustur); } } if(altkume==1) { for(int bir=0;bir<ListBox1->Items->Count;bir++) ListBox2->Items->Add(ListBox1->Items->Strings[bir]); } else if(altkume==2) { for(int bir=0;bir<ListBox3->Items->Count;bir++) ListBox2->Items->Add(ListBox3->Items->Strings[bir]); } else if(altkume>2) { for(int dolan=0;dolan<altkume-2;dolan++) { for(int i=0;i<ListBox3->Items->Count;i++) { String tut=ListBox3->Items->Strings[i]; String virgul=","; while(tut.Length()>0) { int pos=tut.Pos(virgul); String copy=tut; String listesalla=tut.Delete(pos,tut.Length()); ListBox5->Items->Add(listesalla); tut=copy.Delete(1,pos); pos=tut.Pos(virgul); if(pos<1) { ListBox5->Items->Add(tut); break; } }//while sonu for(int j=i+1;j<ListBox3->Items->Count;j++) { String tut=ListBox3->Items->Strings[j]; String virgul=","; while(tut.Length()>0) { int pos=tut.Pos(virgul); String copy=tut; String listesalla=tut.Delete(pos,tut.Length()); int gontrol=0; for(int g=0;g<ListBox6->Items->Count;g++) { if(listesalla==ListBox6->Items->Strings[g]) gontrol=1; } if(gontrol==0) ListBox6->Items->Add(listesalla); tut=copy.Delete(1,pos); pos=tut.Pos(virgul); if(pos<1) { int pontrol=0; for(int g=0;g<ListBox6->Items->Count;g++) { if(tut==ListBox6->Items->Strings[g]) pontrol=1; } if(pontrol==0) ListBox6->Items->Add(tut); break; } } } // icteki for sonu for(int k=0;k<ListBox6->Items->Count;k++) // x foru { int kontrol=0; for(int l=0;l<ListBox5->Items->Count;l++) { if(ListBox6->Items->Strings[k]==ListBox5->Items->Strings[l]) kontrol=1; } String uret=""; int saydir; int konum; for(int m=0;m<ListBox4->Items->Count;m++) { saydir=0; for(int n=0;n<ListBox5->Items->Count;n++) { konum=ListBox4->Items->Strings[m].Pos(ListBox5->Items->Strings[n]); if(konum>0) saydir++; } konum=ListBox4->Items->Strings[m].Pos(ListBox6->Items->Strings[k]); if(konum>0) saydir++; if(saydir==ListBox5->Items->Count+1) kontrol=1; } if(kontrol==0) { for(int z=0;z<ListBox5->Items->Count;z++) { uret+=ListBox5->Items->Strings[z]; uret+=","; } uret+=ListBox6->Items->Strings[k]; ListBox4->Items->Add(uret); }//if sonu } // x foru sonu ListBox5->Items->Clear(); ListBox6->Items->Clear(); } //son for ListBox3->Items->Clear(); for(int donelim=0;donelim<ListBox4->Items->Count;donelim++) { ListBox3->Items->Add(ListBox4->Items->Strings[donelim]); } ListBox4->Items->Clear(); ListBox2->Items->Clear(); for(int bitir=0;bitir<ListBox3->Items->Count;bitir++) { ListBox2->Items->Add(ListBox3->Items->Strings[bitir]); } } }//else if Label2->Caption="Girilen Elemanlara Ait "+IntToStr(altkume)+" Elamanlı Alt Kümeler"; Label3->Caption=IntToStr(ListBox2->Items->Count)+".Adet"; } //--------------------------------------------------------------------------- void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key) { if((Key<'0'||Key>'9')&&(Key!=VK_BACK)) Key=0; } //---------------------------------------------------------------------------


 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları reklam ver Benimmekan Mobil Sohbet
Cevapla

Etiketler
alt, bîr, elemanlı, gösterimi, kümelerinin, kümenin


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Açık
Refbacks are Açık


Benzer Konular
Konu Konuyu Başlatan Forum Cevaplar Son Mesaj
Büyük O Gösterimi Liaaa Ödev ve Tezler 0 23 Mart 2012 17:51
Conway Dizisi Ok Gösterimi Liaaa Ödev ve Tezler 0 23 Mart 2012 17:47
Mybb ip adresi ve yer gösterimi Collettivo MyBB 0 26 Eylül 2008 04:11
özelde img gösterimi __MaXiMuS__ mIRC Scripting Sorunları 3 04 Ekim 2007 21:01
Giris Gösterimi ??? 7610 mIRC Scripting Sorunları 7 22 Eylül 2007 23:41