Advertisement
Guest User

Untitled

a guest
Nov 24th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 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 _1
  8. {
  9. class Program
  10. {
  11. static void IleA(char[] tab)
  12. {
  13. for (int i = 0; i < tab.Length; i++)
  14. {
  15. if (tab[i]=='a')
  16. {
  17. Console.WriteLine(" Na pozycji {0} jest a",i+1);
  18. }
  19. }
  20. }
  21.  
  22. static void Main(string[] args)
  23. {
  24. char[] literki = new char[10];
  25. var dupa = "zadek";
  26. char[] literki2 = dupa.ToArray();
  27. IleA(literki2);
  28. Console.WriteLine("Wpisz litery ");
  29.  
  30. for (int i = 0; i <literki.Length; i++)
  31. {
  32. var read = Console.ReadKey();
  33. literki[i] = read.KeyChar;
  34. }
  35. IleA(literki);
  36.  
  37. Console.ReadKey();
  38. }
  39.  
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement