redSkywalker

Задача_1

Feb 7th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.31 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Zadacha_1
  8. {
  9.     class QuestionaryForNewAdeptsItem
  10.     {
  11.         public string Question;
  12.         public string[] AnswerVariation;
  13.     }
  14.  
  15.     class Door
  16.     {
  17.         public bool IsOpen = false;
  18.     }
  19.  
  20.     class Program
  21.     {
  22.  
  23.         static void Main(string[] args)
  24.         {
  25.             Door[] doors = new Door[] { new Door(), new Door(), new Door() };
  26.  
  27.             Console.WriteLine("Совершенно очевидно, что мы не берём в наш орден кого попало. Поэтому заполни вот эту анкету, " +
  28.                                   "и мы примем решение, брать тебя или нет");
  29.  
  30.             QuestionaryForNewAdeptsItem firstQuest = new QuestionaryForNewAdeptsItem();
  31.             firstQuest.Question = "Кто вы?";
  32.             firstQuest.AnswerVariation = new string[] { "Человек", "Брандлмуха", "Кхаджит" };
  33.  
  34.             QuestionaryForNewAdeptsItem secondQuest = new QuestionaryForNewAdeptsItem();
  35.             secondQuest.Question = "Что вы хотите?";
  36.             secondQuest.AnswerVariation = new string[] { "Победить Аразота", "Стать богатым", "Найти боевых товарищей" };
  37.  
  38.             QuestionaryForNewAdeptsItem thirdQuest = new QuestionaryForNewAdeptsItem();
  39.             thirdQuest.Question = "Чем вы можете помочь ордену?";
  40.             thirdQuest.AnswerVariation = new string[] { "Я отличный воин", "Я добротный маг", "Я могу работать в кузнице" };
  41.  
  42.             QuestionaryForNewAdeptsItem[] questionary = new QuestionaryForNewAdeptsItem[] { firstQuest, secondQuest, thirdQuest };
  43.  
  44.  
  45.             for (int i = 0; i < questionary.Length; i++)
  46.             {
  47.                 var q = questionary[i];
  48.                 Console.WriteLine(q.Question);
  49.                 for (int j = 0; j < q.AnswerVariation.Length; j++)
  50.                 {
  51.                     Console.WriteLine("[{0}]>{1}", j, q.AnswerVariation[j]);
  52.                 }
  53.                 Console.ReadLine();
  54.                 doors[i].IsOpen = true;
  55.  
  56.             }
  57.         }
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment