Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 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 SHAEBASHIT_BYDEM
  8. {
  9. public delegate int F(char, string);
  10. class Program
  11. {
  12. static int Counter(char ch, string str)
  13. {
  14. int counter = 0;
  15. foreach (var e in str)
  16. {
  17. if (e == ch) counter++;
  18. }
  19. return counter;
  20. }
  21.  
  22. static int IndexOf(char ch, string str)
  23. {
  24.  
  25. char[] array = str.ToCharArray();
  26. bool flag = false;
  27. int temp = 0;
  28. for (int i = 0; i < array.Length - 1; i++)
  29. {
  30. if (array[i] == ch)
  31. {
  32. flag = true;
  33. temp = i;
  34. if (flag) break;
  35. }
  36. }
  37. if (!flag) return -1;
  38.  
  39. return temp;
  40. }
  41.  
  42. static void Main(string[] args)
  43. {
  44.  
  45.  
  46. }
  47.  
  48. public static LinkedList<int> Method_Phibonaci(LinkedList<int> list, Func<char,string,int> f)
  49. {
  50. list.AddLast(f(list));
  51. return list;
  52. }
  53.  
  54.  
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement