nikolayneykov

Untitled

Oct 8th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 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 Старата_библиотека
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string TarsenaKniga = Console.ReadLine();
  14.             int KapacitetBiblioteka = int.Parse(Console.ReadLine());
  15.  
  16.             string Kniga = Console.ReadLine();
  17.             int Br = 0;
  18.  
  19.             while (TarsenaKniga != Kniga && Br != KapacitetBiblioteka)
  20.             {
  21.  
  22.                 Kniga = Console.ReadLine();
  23.                 Br = Br + 1;
  24.             }
  25.  
  26.             if (TarsenaKniga == Kniga)
  27.             {
  28.                 Console.WriteLine($"You checked {Br} books and found it.");
  29.             }
  30.             if (Br == KapacitetBiblioteka)
  31.             {
  32.                 Console.WriteLine("The book you search is not here!");
  33.                 Console.WriteLine($"You checked {Br} books.");
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment