fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. #define N 5 // radky
  6. #define M 10 // sloupce
  7.  
  8. int main(void) {
  9. int mat[N][M]; // matice 5x10
  10. int r, s;
  11. int i = 10, j = 20;
  12. int test[i][j];
  13. srand(time(NULL));
  14.  
  15. for (r = 0; r < N; r++) { // postupne prochazeni radku
  16. for (s = 0; s < M; s++) { // postupne prochazeni sloupcu
  17. mat[r][s]= rand() % 20 + 1; // nahodne cislo od 1 do 20
  18. }
  19. }
  20.  
  21. for (r = 0; r < N; r++) {
  22. for (s = 0; s < M; s++) {
  23. printf("%d ", mat[r][s]);
  24. }
  25. printf("\n");
  26. }
  27. printf("exit \n");
  28. }
Compilation error #stdin compilation error #stdout 0.01s 1724KB
stdin
Standard input is empty
compilation info
cc1: warnings being treated as errors
prog.c: In function ‘main’:
prog.c:12: error: unused variable ‘test’
stdout
Standard output is empty