Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. Console.Write("Enter array`s lenghts: ");
  2.             int n = int.Parse(Console.ReadLine());
  3.            
  4.             string[] books = new string[n];
  5.             string[] authors = new string[n];
  6.  
  7.  
  8.             for (int i = 0; i < books.Length; i++)
  9.             {
  10.                 Console.WriteLine("The name of the book: ");
  11.                 books[i] = Console.ReadLine();
  12.                 Console.WriteLine("The name of the author: ");
  13.                 authors[i] = Console.ReadLine();
  14.             }
  15.  
  16.             for (int i = 0; i < books.Length; i++)
  17.             {
  18.                 if (authors[i].Trim().ToLower()=="ivan vazov")
  19.                 {
  20.                     Console.WriteLine("The book is {0} by the author {1}.",books[i],authors[i]);
  21.                 }
  22.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement