LaDissertation.com - Dissertations, fiches de lectures, exemples du BAC
Recherche

Algorithme.

TD : Algorithme.. Recherche parmi 297 000+ dissertations

Par   •  14 Décembre 2016  •  TD  •  1 537 Mots (7 Pages)  •  673 Vues

Page 1 sur 7

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApplication68

{

class Program

{

public class drapeauHollandais

{

private int n;

private char[] t = new char[15];

public drapeauHollandais(int n)

{

int i;

i = 0;

int has=0;

Console.WriteLine("Les boules random :");

//t = new char[n];

Random randNum = new Random();

while (i<15)

{

has = randNum.Next(3);

if (has == 0)

{

t[i] = 'B';

}

else if (has == 1)

{

t[i] = 'W';

}

else

{

t[i] = 'R';

}

i++;

}

}

public void afficher()

{

int i;

i = 0;

while (i<15)

{

Console.WriteLine(t[i]);

i++;

}

}

public void reordonne()

{

...

Télécharger au format  txt (2.6 Kb)   pdf (40.5 Kb)   docx (8.5 Kb)  
Voir 6 pages de plus »
Uniquement disponible sur LaDissertation.com