Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Pesquisasimples
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. bool loop = true;
  10. string[] array = new string[] {"Adamastor","Thiago","Alex","Biroliro" };
  11.  
  12. for (int i=0;i<array.Length;i++) {
  13. Console.WriteLine(array[i]);
  14. }
  15. Console.ReadLine();
  16.  
  17. while (loop == true)
  18. {
  19. Console.WriteLine("Pesquise um nome");
  20. string nomepesquisa = Console.ReadLine();
  21. for (int i = 0; i < array.Length; i++)
  22. {
  23. if (array[i].ToUpper().Contains(nomepesquisa.ToUpper()))
  24. {
  25. Console.WriteLine(" ");
  26. Console.WriteLine("Nome(s) encontrado(s): " + array[i]);
  27. }
  28.  
  29.  
  30. }
  31. Console.ReadLine();
  32. }
  33.  
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement