Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 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 ConsoleApp1
  8. {
  9. class ArrayCreation
  10. {
  11. public int[] CreateArray(int ArraySize)
  12. {
  13. int[] masyvas = new int[ArraySize];
  14.  
  15. for (int i = 0; i <= masyvas.Length - 1; i++)
  16. {
  17. masyvas[i] = i;
  18. }
  19. return masyvas;
  20. }
  21.  
  22. public void OddEvenCheck(int[] masyvas)
  23. {
  24. for (int index = 0; index <= masyvas.Length - 1; index++)
  25. {
  26. if (masyvas[index] % 3 == 0)
  27. {
  28. Console.WriteLine("Sneaky" + masyvas[index]);
  29. }
  30.  
  31. if (masyvas[index] % 5 == 0)
  32. {
  33. Console.WriteLine("Box" + masyvas[index]);
  34. }
  35. }
  36. }
  37. }
  38.  
  39. class Control
  40. {
  41. static void Main(string[] args)
  42. {
  43. ArrayCreation array = new ArrayCreation();
  44. Console.WriteLine("Insert array size");
  45. string line = Console.ReadLine();
  46. int a = int.Parse(line);
  47.  
  48. array.OddEvenCheck(array.CreateArray(a));
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement