Visa ett inlägg
Oläst 2011-07-03, 22:08 #2
Kekke Kekke är inte uppkopplad
Medlem
 
Reg.datum: Feb 2011
Inlägg: 198
Kekke Kekke är inte uppkopplad
Medlem
 
Reg.datum: Feb 2011
Inlägg: 198
Kod:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace rand
{
    class Program
    {
        static Random random = new Random();

        static void Main(string[] args)
        {
            PrintRandomNumbers(5);
            Console.Read();
        }

        static void PrintRandomNumbers(int iRandomNo)
        {
            for (int i = 0; i < iRandomNo; i++)
            {
                Console.Write(random.Next(iRandomNo));
            }
        }
    }
}
Slumpar iRandomNo tal från 0-iRandomNo
Kekke är inte uppkopplad   Svara med citatSvara med citat