[ / / / / / / / / / / / / / ] [ dir / bbbb / leftpol / maka / pinoy / rel / sonyeon / tijuana / ttyn ]

/5edmamta3i/ - 5edma

mta3i

Catalog

Winner of the 24rd Attention-Hungry Games
/kemono/ - A match made in heaven

Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4
Max filesize is 16 MB.
Max image dimensions are 15000 x 15000.
You may upload 5 per post.


 No.2[Reply]


#include <stdio.h>

void echange(int* n1, int* n2)
{
int aux;
aux = *n1;
*n1 = *n2;
*n2 = aux;
}
void permut_tableau(int n,int t[])
{
int i,j,iMin;
for (j = 0; j < n-1; j++)
{

iMin = j;
for ( i = j+1; i < n; i++)
{
if (t[i] < t[iMin])
{
iMin = i;
}
}

if(iMin != j)
{
echanger(&t[j],&t[iMin]);
}
}
}
int saisie ()
{
int n;
printf("donner la longeur du tableau : ");
scanf("%d",&n);
return n;
}
void remplir (int t[], int n)
{
int i;
for (i=0;i<n;i++)
{
printf("t[%d]= ",i);
scanf("%d",&t[i]);

}
}

int main(void) {
int i,n,t[100];
n=saisie();
remplir(t,n);
permut_tableau(n,t);
for (i=0;i<n;i++)
printf("t[%d]=%d\n",i,t[i]);
}



 No.1[Reply]

[code]

#include <stdio.h>

void echange(int* n1, int* n2)

{

int aux;

aux = *n1;

*n1 = *n2;

*n2 = aux;

}

void permut_tableau(int n,int t[])

{

int i,j,iMin;

for (j = 0; j < n-1; j++)

{

iMin = j;

for ( i = j+1; i < n; i++)

{

if (t[i] < t[iMin])

{

iMin = i;

}

}

if(iMin != j)

{

echanger(&t[j],&t[iMin]);

}

}

}

int saisie ()

{

int n;

printf("donner la longeur du tableau : ");

scanf("%d",&n);

return n;

}

void remplir (int t[], int n)

{

int i;

for (i=0;i<n;i++)

{

printf("t[%d]= ",i);

scanf("%d",&t[i]);

}

}

int main(void) {

int i,n,t[100];

n=saisie();

remplir(t,n);

permut_tableau(n,t);

for (i=0;i<n;i++)

printf("t[%d]=%d\nPost too long. Click here to view the full text.



Delete Post [ ]
[]
Previous [1] Next | Catalog | Nerve Center | Cancer
[ / / / / / / / / / / / / / ] [ dir / bbbb / leftpol / maka / pinoy / rel / sonyeon / tijuana / ttyn ]