Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class ArrayCreation
- {
- public int[] CreateArray(int ArraySize)
- {
- int[] masyvas = new int[ArraySize];
- for (int i = 0; i <= masyvas.Length - 1; i++)
- {
- masyvas[i] = i;
- }
- return masyvas;
- }
- public void OddEvenCheck(int[] masyvas)
- {
- for (int index = 0; index <= masyvas.Length - 1; index++)
- {
- if (masyvas[index] % 3 == 0)
- {
- Console.WriteLine("Sneaky" + masyvas[index]);
- }
- if (masyvas[index] % 5 == 0)
- {
- Console.WriteLine("Box" + masyvas[index]);
- }
- }
- }
- }
- class Control
- {
- static void Main(string[] args)
- {
- ArrayCreation array = new ArrayCreation();
- Console.WriteLine("Insert array size");
- string line = Console.ReadLine();
- int a = int.Parse(line);
- array.OddEvenCheck(array.CreateArray(a));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement