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.  
  25. for (int index = 0; index <= masyvas.Length - 1; index++)
  26. {
  27. if (masyvas[index] % 3 == 0)
  28. {
  29. Console.WriteLine("Sneaky" + masyvas[index]);
  30. }
  31.  
  32. if (masyvas[index] % 5 == 0)
  33. {
  34. Console.WriteLine("Box" + masyvas[index]);
  35. }
  36. }
  37. }
  38. }
  39.  
  40. class Control
  41. {
  42. static void Main(string[] args)
  43. {
  44. ArrayCreation array = new ArrayCreation();
  45. Console.WriteLine("Insert array size");
  46. string line = Console.ReadLine();
  47. int a = int.Parse(line);
  48.  
  49.  
  50.  
  51. array.OddEvenCheck(array.CreateArray(a));
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement