Neon1x1st

Control

Dec 22nd, 2021
1,503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace CSharpLight
  7. {
  8.  
  9.     public static class Program
  10.     {
  11.         public static void Main()
  12.         {
  13.             Console.WriteLine("Подбрасываем монетку?");
  14.             string userInput = Console.ReadLine();
  15.             while (userInput != ("exit"))
  16.             {
  17.                     Console.Write("Введите количество бросков: ");
  18.                     int repeat = Convert.ToInt32(Console.ReadLine());
  19.                     Random rand = new Random();
  20.                     int random;
  21.                     for (int i = 0; i < repeat; i++)
  22.                     {
  23.                         random = rand.Next(0, 2);
  24.                         Console.WriteLine(random);
  25.                     }
  26.                     Console.WriteLine("Повторить операцию или exit для выхода");
  27.                     userInput = Console.ReadLine();
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment