fork download
  1. #include <stdio.h>
  2. #include<cstdlib>
  3.  
  4.  
  5. using namespace std;
  6. int main (void)
  7. {
  8. int i;
  9. double j;
  10. int vstup1;
  11. ///*int vstup2;int n; //potvrzovaci vstup
  12.  
  13. printf("zadej počet řádků a počet sloupců \n");
  14. vstup1=scanf("%d\n%d",&i,&j);
  15. ///*vstup2=scanf("overovaci znak",&n);
  16. ///*if(n="overovaci znak"){printf("ok\n");}else{printf("error1chyba potvrzeni");}
  17.  
  18. //printf("radky:%d \n",i);
  19. //printf("sloupce:%d \n",j);
  20. ///*printf("%d \n",vstup1);vstup1=vstup1+vstup2;
  21. //printf("pocet vstupu%d \n",vstup1);
  22. ///*if(vstup1==3){
  23. if(vstup1==2){
  24. printf("sloupce %d \n",j);
  25. printf("radky %d \n",i);
  26. }else{printf("error_v1");}
  27. int mat[i][j];
  28. int o;
  29. int k;
  30. srand(time(NULL));
  31. for (o=0;o<=i;o++){
  32. for (k=0;k<=j;k++){
  33. mat[i][j]=rand()%9+0;
  34. }
  35. }
  36. for (o=0;o<=i;o++){
  37. for (k=0;k<=j;k++){
  38. printf("%d ",mat[o][k]);
  39. }printf("\n");
  40. }
  41. printf("exit \n");getchar();
  42. /*vstup1=scanf("%d %d\n",&i,&j);
  43. printf("%d\n",vstup1);
  44. getchar();*/
  45. return 0;
  46. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14: warning: format ‘%d’ expects type ‘int*’, but argument 3 has type ‘double*’
prog.cpp:24: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘double’
prog.cpp:27: error: size of array ‘mat’ has non-integral type ‘double’
prog.cpp:30: error: ‘time’ was not declared in this scope
prog.cpp:33: error: invalid types ‘int [1][double]’ for array subscript
stdout
Standard output is empty