fork download
  1. /chulla vida
  2. #include<stdio.h>
  3. #include<conio.h>
  4. #include<stdlib.h>
  5. main()
  6. {
  7. int k,i,fila,colum,Matriz_A[100][100];
  8. char A[10],*p; //a=[1,2,3];[1,2,3];[1,2,3]
  9. printf("Ingrese la matriz: ");
  10. gets(A);
  11. p=&A[0];
  12. fila=0;
  13. colum=0;
  14. if(*p=='='&&*(p+1)=='[')
  15. {
  16. p=(p+2);
  17. while(*p!='\0'){
  18. //printf("%c",*p);
  19. if(*p==']'&&*(p+1)==';'&&*(p+2)=='[')
  20. {
  21. p=(p+2);
  22. fila++;
  23. colum=0;
  24. }
  25. else
  26. {
  27. switch (*p)
  28. {
  29. case '1':
  30. Matriz_A[fila][colum]=1;
  31.  
  32. colum++;
  33. break;
  34. case '2':
  35. Matriz_A[fila][colum]=2;
  36.  
  37. colum++;
  38. break;
  39. case '3':
  40. Matriz_A[fila][colum]=3;
  41.  
  42. colum++;
  43. break;
  44. default:
  45. //nada
  46. break;
  47. }
  48.  
  49. }
  50.  
  51.  
  52. p=(p+1);
  53. }
  54. for(i=0;i<=fila;i++)
  55. {
  56.  
  57. for(k=0;k<=colum-1;k++)
  58. {
  59. printf("\t%i",Matriz_A[i][k]);
  60. }
  61. printf("\n");
  62. }
  63. }
  64. else
  65. {printf("Error");
  66.  
  67. }
  68. getch();
  69.  
  70. }
  71.  
  72.  
  73.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:1: error: expected identifier or ‘(’ before ‘/’ token
 /chulla vida
 ^
In file included from /usr/include/stdio.h:74:0,
                 from prog.c:2:
/usr/include/libio.h:302:3: error: unknown type name ‘size_t’
   size_t __pad5;
   ^~~~~~
/usr/include/libio.h:305:67: error: ‘size_t’ undeclared here (not in a function)
   char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
                                                                   ^~~~~~
/usr/include/libio.h:333:62: error: expected declaration specifiers or ‘...’ before ‘size_t’
 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
                                                              ^~~~~~
/usr/include/libio.h:342:6: error: expected declaration specifiers or ‘...’ before ‘size_t’
      size_t __n);
      ^~~~~~
/usr/include/libio.h:464:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’
 extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
                   ^~~~~~~~~
In file included from prog.c:2:0:
/usr/include/stdio.h:339:20: error: expected declaration specifiers or ‘...’ before ‘size_t’
       int __modes, size_t __n) __THROW;
                    ^~~~~~
/usr/include/stdio.h:388:44: error: expected declaration specifiers or ‘...’ before ‘size_t’
 extern int snprintf (char *__restrict __s, size_t __maxlen,
                                            ^~~~~~
/usr/include/stdio.h:392:45: error: expected declaration specifiers or ‘...’ before ‘size_t’
 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
                                             ^~~~~~
/usr/include/stdio.h:711:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’
 extern size_t fread (void *__restrict __ptr, size_t __size,
               ^~~~~
/usr/include/stdio.h:717:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’
 extern size_t fwrite (const void *__restrict __ptr, size_t __size,
               ^~~~~~
prog.c:3:18: fatal error: conio.h: No such file or directory
 #include<conio.h>
                  ^
compilation terminated.
stdout
Standard output is empty