JustPaste.it


class Program
{
static void Main(string[] args)
{
int[] action = new int[15];
int[] result = new int[5];
for (int i = 0; i < action.Length; i++)
{
if(i%3==0)
Console.WriteLine("Please enter a number (1/2):");
else
Console.WriteLine("Please enter any number:");
action[i] = int.Parse(Console.ReadLine());

}
int k = 0;
for (int i = 0; i+2 < action.Length; i+=3)
{
int res;
switch (action[i])
{
case 1:
res = action[i + 1] + action[i + 2];
break;
default:
res = action[i + 1] - action[i + 2];
break;
}
k+=2;
result[(i+2)-k] = res;
}


}
}