Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
bitwise_operation__end-of-class
Float data type.c
Max2
ayudantia ejercicio 2 numero nashee
18BCE2182 ASSESS_1 Q2-1
18BCE2182 ASSESS_3 Q3
Memory leak
c. new one
A_141121_fibonacci
main.c
Please log in to post a comment.