/******************************************************************************
Online C# Compiler.
Code, Compile, Run and Debug C# program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
using System;
class HelloWorld {
public static void test_array5()
{
int[] k = { 4,6,8, 3,2,1,9 };
for (int i = 2; i < 7; i++)
{
k[i] = k[i - 1] + k[8 - i];
}
}
public static void test_array6()
{
int[] a = { 9, 0, 9, 5, 6, 3, 4 };
//1
for (int i = 0; i < 7; i++)
if (a[i] > i)
Console.WriteLine(a[i]);
//3
for (int i = 0; i < 7; i++)
if (a[i] % 3 == 0)
Console.WriteLine(a[i]);
//4
for (int i = 1; i < 7; i++)
a[i] = a[i - 1];
//5
for (int i = 0; i < 6; i++)
a[i] = a[i + 1];
//6
for (int i = 0; i < 7; i++)
if (i % 2 == 0)
a[i] = 9;
else
a[i] = 3;
}
public static void test_array7()
{
int[] a = { 9, 0, 9, 5, 6, 3, 4 };
//2
int i = 0;
while (i < 7)
{
Console.WriteLine(a[i]);
i = i + 2;
}
}
static void Main() {
Console.WriteLine("Hello World");
test_array5();
test_array6();
test_array7();
}
}