Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C_141127:MatricesUnSoloIndice
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> #define _F 3 #define _C 4 int main(void) { long m1[_F][_C]; short i, j, c, f, contador; for(srand(time(NULL)) , f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { m1[f][c] = rand() % 200; } } for(f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { printf("%6ld", m1[f][c]); } printf("\n"); } for(contador = 0 , i = 0 ; i < _F * _C ; i++) { for(j = i + 1 ; j < _F * _C ; j++) { if(m1[i / _C][i % _C] == m1[j / _C][j % _C]) { contador++; } } } if(contador != 0) { printf("SÍ REPETIDOS\n\n"); } else { printf("NO REPETIDOS\n\n"); } return 0; }
run
|
edit
|
history
|
help
0
experimento con quicksort
19BCE0666.C
Mem alloc test
20171117_PITAGORAS
REGISTRO EN C
Pattern 13
Primo compuesto
int_A_1a.c
Lab 9 v0.95
Character testing