Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace test_2
- {
- class Program
- {
- public void Run()
- {
- const int count = 5;
- Random rand = new Random();
- bool[] isAnswered = new bool[count];
- string[] qustions = new string[count];
- qustions[0] = "Как зовут змею Волан-де-Морта? \n1) Невил \n2) Нагайна \n3) Хагрид";
- qustions[1] = "Кто закрыл проход на платформу 9 3⁄4 во втором фильме? \n1) Добби \n2) Волан-де-Морт \n3) Гермиона"; qustions[2] = "Кто был звездой на первой карточке от шоколадной лягушки Гарри? \n1) Волан-де-Морт \n2) Шрек \n3) Альбус Дамблдор";
- qustions[3] = "Был ли Гарри старостой факультета? \n1) Да \n2) Нет";
- qustions[4] = "Сколько крестражей у волан де морта? \n1) 7 \n2) 5 \n3) 13";
- while (HaveUnansweredQuestions(isAnswered))
- {
- int index = rand.Next(5);
- if (isAnswered[index])
- {
- continue;
- }
- else
- {
- Console.WriteLine($"Вопрос№{index + 1}: {qustions[index]}");
- isAnswered[index] = true;
- }
- }
- }
- bool HaveUnansweredQuestions(bool[] isAnswered)
- {
- for (int i = 0; i < isAnswered.Length; i++)
- {
- if (isAnswered[i])
- {
- continue;
- }
- return true;
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement