using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class zar
{
static void Main(string[] args)
{
int zar;
int
zar1=0, zar2=0, zar3=0, zar4=0, zar5=0, zar6=0;
int sayac;
for (sayac = 0; sayac <= 100; )
{
Random rnd = new Random();
zar = (int)rnd.Next(1, 7);
sayac++;
switch (zar)
{
case 1:
zar1++;
break;
case 2:
zar2++;
break;
case 3:
zar3++;
break;
case 4:
zar4++;
break;
case 5:
zar5++;
break;
case 6:
zar6++;
break;
}
}
Console.WriteLine("zar1="+zar1);
Console.WriteLine("zar2="+zar2);
Console.WriteLine("zar3="+zar3);
Console.WriteLine("zar4="+zar4);
Console.WriteLine("zar5="+zar5);
Console.WriteLine("zar6="+zar6);
Console.ReadKey();
}
}
}
Hiç yorum yok:
Yorum Gönder