Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
B_141128_MatrizUnSoloIndice
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> #define _F 12 #define _C 8 int main(void) { long a[_F][_C]; short f, c, i, j; short centinela; for(srand(time(NULL)) , f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { a[f][c] = rand() % 10001; } } for(centinela = 1 , i = 0 ; i < _F * _C && centinela ; i++) { for(j = i + 1 ; j < _F * _C && centinela ; j++) { if(a[i / _C][i % _C] == a[j / _C][j % _C]) { centinela = 0; } } } for(f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { printf("%7ld", a[f][c]); } printf("\n"); } printf("\n\n\n"); if(centinela) { printf("NO HAY REPETIDOS\n\n\n"); } else { printf("SÍ HAY REPETIDOS\n\n\n"); } return 0; }
run
|
edit
|
history
|
help
0
A_141205_CADENAS
A_141128_MatricesSuma
6 ejercicio trabajo semanal 4
tarun ceo
Euclides MIRAR
CharacterInput
Difference between memcpy n strncpy
project 5 v0.04
PART 2
Project 5 v0.11