Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <stdio.h>
- #include <conio.h>
- #include <stdlib.h>
- #define N 10
- //#pragma hdrstop
- //---------------------------------------------------------------------------
- //#pragma argsused
- main()
- {
- int arre[N], arre2[N], arre3[N],i=0, cont=0, j=0,k=0, x;
- clrscr();
- randomize();
- printf("los numeros a ordenar son: \n");
- for(i=0; i<N; i++)
- {
- arre[i] = random(100);
- printf("%d\n",arre[i]);
- }
- while(cont < 10)
- {
- for(i=0; i<N; i++)
- {
- x = ((arre[i])/10);
- if(cont == x)
- {
- arre2[j] = arre[i];
- j++;
- }
- }
- cont++;
- }
- cont = 1;
- while(cont < 100)
- {
- for(j=0; j<N; j++)
- {
- if(cont == arre2[j])
- {
- arre3[k] = arre2[j];
- k++;
- }
- }
- cont++;
- }
- printf("Los numeros ordenados son \n");
- for(k=0; k<N; k++)
- printf("%d\n",arre3[k]);
- getch();
- return 0;
- }
- //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement