#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 7 of file 021_Conteno.c.
8{
10 do{
11 printf("Ingrese el numero de elementos: ");
12 scanf("%d", &n);
14 printf("Ingrese el valor maximo: ");
16 printf("Ingrese el valor minimo: ");
19 {
23 }
25 srand(time(NULL));
26 for(i=0; i<n; i++)
28 printf("Desordenado.\n");
29 for(i=0; i<n; i++)
30 printf("X[%d] = %d\n", i+1, X[i]);
31 int h[rg+1];
32 for(i=0; i<rg+1; i++)
33 h[i] = 0;
34 for(i=0; i<n; i++)
36 printf("Histograma\n");
37 for(i=0; i<rg+1; i++)
38 printf(
"h[%d] = %d\n",
min+i, h[i]);
39 for(i=0, j=0; i<n; )
40 {
41 while(!h[j])
42 j++;
43 while(h[j])
44 {
45 h[j]--;
47 }
48 }
49
50 printf("Ordenado.\n");
51 for(i=0; i<n; i++)
52 printf("X[%d] = %d\n", i+1, X[i]);
53 return 0;
54}