Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- namespace Библиотека___2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string needBooks = Console.ReadLine();
- string giveBooks = Console.ReadLine();
- bool isBooktrue = false;
- int checkedBooks = 0;
- while (giveBooks != "No More Books")
- {
- giveBooks = Console.ReadLine();
- checkedBooks++;
- if (needBooks == giveBooks)
- {
- isBooktrue = true;
- break;
- }
- }
- if (isBooktrue)
- {
- Console.WriteLine($"You checked {checkedBooks} books and found it.");
- }
- else
- {
- Console.WriteLine("The book you search is not here!");
- Console.WriteLine($"You checked {checkedBooks} books.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment