Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ============================================================================
- Name : TriParPosition.c
- Author : abdou
- Version :
- Copyright : Your copyright notice
- Description : Hello World in C, Ansi-style
- ============================================================================
- */
- #include <stdio.h>
- #include <stdlib.h>
- int T[5],P[5],R[5];
- short i,j,k,posit,h;
- int main(void) {
- printf("Entrer des valeur: ");
- for(i=0;i<5;i++){ scanf("%d",&T[i]);}
- j=0;
- for(h=0;h<5;h++)
- {
- posit=0;
- for(i=0;i<5;i++)
- {
- if(T[h] > T[i])
- {
- posit=posit+1;
- }
- }
- P[j]=posit;
- j=j+1;
- }
- k=0;
- for(i=0;i<5;i++)
- {
- for(j=0;j<5;j++)
- {
- if(P[j]==i)
- {
- R[k]=T[j];
- k=k+1;
- }
- }
- }
- for(i=0;i<5;i++){printf("%d",R[i]);}
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement