Advertisement
xomanya

2.6

Aug 18th, 2019
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 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 DZ2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Отгадай загадку: кто говорит на всех языках?");
  14.             Console.WriteLine("У тебя 3 попытки! Также ты модешь сдаться в любой момент");
  15.             for (int i = 3; i > 0; i--)
  16.             {
  17.                 string answer = Console.ReadLine();
  18.                
  19.                 if (answer == "Эхо" || answer == "ЭХО" || answer == "эхо")
  20.                 {
  21.                     Console.WriteLine("Правильно.");
  22.                     break;
  23.                 }
  24.                 else if (i == 1)
  25.                 {
  26.                     Console.WriteLine("Эх... Ты не угадал.");
  27.                 }
  28.                 else if (answer == "Сдаюсь" || answer == "сдаюсь")
  29.                 {
  30.                     Console.WriteLine("Правильный ответ: эхо.");
  31.                     break;
  32.                 }
  33.                 else
  34.                 {
  35.                     Console.WriteLine("Подумай еще.");
  36.          
  37.                 }
  38.             }
  39.  
  40.         }    
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement