Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)

Paste

Pasted as C# by polje ( 13 years ago )
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace listing3
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] polje = new int[10];
            for (int j = 0; j < polje.Length; j++)
            {
                polje[j] = j;
            }
            int temp = polje[0];

            for (int i = 1; i < polje.Length; i++)
            {
                polje[i - 1] = polje[i];
            }
            polje[polje.Length - 1] = temp;
            for (int p = 0; p < polje.Length; p++)
            {
                Console.Write(polje[p]+" ");
            }
            Console.WriteLine();
            foreach (int k in polje)
            {
                Console.Write(polje[k]+" ");
            }
            Console.ReadKey();
        }
    }
}

 

Revise this Paste

Parent: 68483
Your Name: Code Language: