Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSharpLight
- {
- public static class Program
- {
- public static void Main()
- {
- Console.WriteLine("Подбрасываем монетку?");
- string userInput = Console.ReadLine();
- while (userInput != ("exit"))
- {
- Console.Write("Введите количество бросков: ");
- int repeat = Convert.ToInt32(Console.ReadLine());
- Random rand = new Random();
- int random;
- for (int i = 0; i < repeat; i++)
- {
- random = rand.Next(0, 2);
- Console.WriteLine(random);
- }
- Console.WriteLine("Повторить операцию или exit для выхода");
- userInput = Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment