cs_domxaline
Messages postés327Date d'inscriptionjeudi 21 août 2008StatutMembreDernière intervention10 mai 2012
-
19 août 2009 à 10:52
ouabida10
Messages postés57Date d'inscriptionmardi 4 août 2009StatutMembreDernière intervention 9 janvier 2011
-
20 août 2009 à 14:53
Bonjour,
comme le titre dit,mon prg affiche aucun resultat
public class Sansimport
{
public static void main(String []args)
{
int n = 0;
int [] tab = new int[n];
for(int i = 0; i < (n - 1); i++)
{
for(int i1 = 0; i1 < (n - 1); i1++)
{
if(tab[i1] > tab[i1 + 1])
{
int tempo = tab[i1];
tab[i1] = tab[i1 + 1];
tab[i1 + 1] = tempo;
}
}
}
// affichage du tableau
for(int i = 0; i < n; i++)
{
System.out.print(tab[i] + " " );
}
}
}
hafidaagourram
Messages postés6Date d'inscriptionsamedi 15 août 2009StatutMembreDernière intervention12 mai 2010 19 août 2009 à 11:26
Bonjour,
si j'ai bien compris votre programme.
votre programme permet d'afficher le TRI d'un tableau n'est ce pas?
vous avez initialise n par ZÉRO et n c'est la taille du tableau !!!
vous devez faire quelque modification concernant la taille.