Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace OldBooks
- {
- class Program
- {
- static void Main(string[] args)
- {
- string favoriteBook = Console.ReadLine();
- string currentBook = Console.ReadLine();
- int bookCount = 0;
- while (currentBook != favoriteBook)
- {
- if (currentBook == "No More Books")
- {
- Console.WriteLine($"The book you search is not here!\nYou checked {bookCount} books.");
- }
- bookCount++;
- currentBook = Console.ReadLine();
- }
- Console.WriteLine($"You checked {bookCount} books and found it.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement