1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
import java.io.*;
class clavier
{
static int x;
static int tab[]=new int[5];
static int clavier()throws IOException
{
BufferedReader passmoi=new BufferedReader(new InputStreamReader(System.in));
int a=Integer.parseInt(passmoi.readLine());
return(a);
}
public static void main(String[]args)throws IOException
{
for(int i=0;i<tab.length;i++)
{
System.out.println("entrer la i eme valeur ");
tab[i] =clavier();
//System.out.println(tab[i]);
}
for(int b=0;b<=tab.length;b++)
{
for(int j=b+1;j<=tab.length;j++)
{
if(tab[b]<tab[j])
{
x =tab[j];
tab[j]=tab[b];
tab[b]=x;
}
}
}
for(int i=0;i<tab.length;i++)
{
System.out.println(tab[i]);
}
}
} |
Partager