Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
AnasayfaAnasayfa  PortalliPortalli  AramaArama  Latest imagesLatest images  Kayıt OlKayıt Ol  Giriş yap  

 

 c# ile sayısal loto programı

Aşağa gitmek 
YazarMesaj
YohAsakura
Seviyeli Üye
Seviyeli Üye
YohAsakura


Mesaj Sayısı : 194
Yaş : 31
Şehir : Dobbie Willage
Kayıt tarihi : 04/08/06

c# ile sayısal loto programı Empty
MesajKonu: c# ile sayısal loto programı   c# ile sayısal loto programı Icon_minitimeÇarş. 9 Ağus. - 14:52

int sayi;
int m=0;
listBox1.Items.Clear();
Random rasgele=new Random();
ArrayList dizi=new ArrayList();
int[] loto=new int[6];
int deger;
for (int i=0;i<=48;i++)
{
dizi.Add(i+1);
}
for (int i=0;i<=5;i++)
{
deger=rasgele.Next()%dizi.Count+1;
loto[i]=Convert.ToInt32(dizi[deger-1]);
dizi.RemoveAt(deger-1);
}

for (int j=0;j<=5;j++)
{
for (int k=j+1;k<=5;k++)
{
if ( loto[j]>loto[k])
{
sayi=loto[j];
loto[j]=loto[k];
loto[k]=sayi;
}
m++;
}
}
foreach (int eleman in loto)
{
listBox1.Items.Add(eleman);
}
this.Text=m.ToString();
Sayfa başına dön Aşağa gitmek
http://wapistan.forumup.com
 
c# ile sayısal loto programı
Sayfa başına dön 
1 sayfadaki 1 sayfası
 Similar topics
-

Bu forumun müsaadesi var:Bu forumdaki mesajlara cevap veremezsiniz
 :: Diğer :: DownloaD-
Buraya geçin: