Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_141201_MatrizTodosDistintos
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> #define _F 10 #define _C 8 int main(void) { long m[_F][_C]; short f, c; short i, j, centinela; for(srand(time(NULL)) , f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { m[f][c] = rand() % 1001; } } for(centinela = 1 , i = 0 ; i < _F * _C && centinela ; i++) { for(j = i + 1 ; j < _F * _C && centinela ; j++) { if(m[i / _C][i % _C] == m[j / _C][j % _C]) { centinela = 0; } } } for(f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { printf("%6ld", m[f][c]); } printf("\n"); } if(centinela == 1) printf("No hay repetidos\n\n"); else printf("Sí hay repetidos\n\n"); return 0; }
run
|
edit
|
history
|
help
0
Command Expressions in Gnu C
Project 3 Part 1 v1.6
A_141124arrayRepetidos
A_141212_OrdenarArray
sjf
Area of the Cone
Assignment 4
Test1
Serie de Fibonacci
20171117_TARTAGLIA