Porównaj commity
4 commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| f0f11ba1c2 | |||
| 6a6ad6ac7e | |||
|
|
e8abaa204f | ||
|
|
0c3589607f |
2 zmienionych plików z 45 dodań i 0 usunięć
42
TD1.c
Normal file
42
TD1.c
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
int dim=3;
|
||||||
|
int tab[3];
|
||||||
|
|
||||||
|
void afficherTableau (int tab [], int dim)
|
||||||
|
{
|
||||||
|
int i ;
|
||||||
|
for (i=0;i<dim;i++)
|
||||||
|
{ printf ("%d", tab[i]);
|
||||||
|
printf ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int c ;
|
||||||
|
int compteur=1;
|
||||||
|
int i;
|
||||||
|
tab[0]=1;
|
||||||
|
tab[1]=3;
|
||||||
|
tab[2]=2;
|
||||||
|
|
||||||
|
|
||||||
|
while (compteur!=0)
|
||||||
|
{
|
||||||
|
compteur=0;
|
||||||
|
for (i=0;i<dim;i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(tab[i+1]<tab[i])
|
||||||
|
{
|
||||||
|
c=tab[i+1];
|
||||||
|
tab[i+1]=tab[i];
|
||||||
|
tab[i]=c;
|
||||||
|
compteur++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
afficherTableau(tab,dim);
|
||||||
|
}
|
||||||
|
//commentaire
|
||||||
3
hola
Normal file
3
hola
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
hola
|
||||||
|
Soy louis-Gabriel y tu?
|
||||||
|
Ablar no espagnol, so sorry
|
||||||
Ładowanie…
Reference in a new issue