Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
20161118_ArrayRepetidos
//gcc 4.9.3 #include <stdio.h> #include <stdlib.h> #include <time.h> #define _T 10 int main(void) { short a[_T]; long i, j; short bandera; srand(time(NULL)); for(i = 0 ; i < _T ; i++) { a[i] = 1 + rand() % 30; } for(i = 0 ; i < _T ; i++) { if(i % 5 == 0) { printf("\n"); } printf("%8hd", a[i]); } for(i = 0 , bandera = 1 ; i < _T && bandera ; i++) { for(j = i + 1 ; j < _T && bandera ; j++) { if(a[i] == a[j]) { bandera = 0; } } } if(bandera) { printf("NO HAY REPETIDOS...\n\n"); } else { printf("SI HAY REPETIDOS...\n\n"); } return 0; }
run
|
edit
|
history
|
help
0
quadsort vs qsort
Camping
Command Expressions in Gnu C
Lab 9 v1
A_141124_arrayMaxMin01
recurs fibo1
Bitwise Operations
PointTeleBook
assignment 3 celina
-Shello.c