Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp13
- {
- class Program
- {
- static void Main(string[] args)
- {
- int beker = int.Parse(Console.ReadLine());
- int case_switch;
- int egy = 0, ketto = 0, harom = 0, negy = 0, ot = 0, hat = 0;
- Random r = new Random();
- for (int i = 0; i <= beker; i++)
- {
- case_switch = r.Next(0, 7);
- switch(case_switch)
- {
- case 1:
- egy++;
- Console.WriteLine("1");
- break;
- case 2:
- ketto++;
- Console.WriteLine("2");
- break;
- case 3:
- harom++;
- Console.WriteLine("3");
- break;
- case 4:
- negy++;
- Console.WriteLine("4");
- break;
- case 5:
- ot++;
- Console.WriteLine("5");
- break;
- case 6:
- hat++;
- Console.WriteLine("6");
- break;
- }
- }
- Console.WriteLine("{0} darab egyes lett",egy);
- Console.WriteLine("{0} darab kettes lett", ketto);
- Console.WriteLine("{0} darab harmas lett", harom);
- Console.WriteLine("{0} darab negyes lett", negy);
- Console.WriteLine("{0} darab otos lett", ot);
- Console.WriteLine("{0} darab hatos lett", hat);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment