fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4.  
  5. int main(void)
  6. {
  7. int A, B, N, i, teste;
  8.  
  9. scanf("%i", &N);
  10.  
  11. char R[N];
  12.  
  13. for(i = 1;i <= N;i++)
  14. {
  15. scanf("%i %i", &A, &B);
  16.  
  17. teste = (A + B) % 2;
  18.  
  19. if(teste == 0)
  20. {
  21. strcpy(R[i], "Par");
  22. }
  23.  
  24. else
  25. {
  26. strcpy(R[i], "Impar"); }
  27. }
  28.  
  29. for(i = 1;i <= N;i++)
  30. {
  31. printf("\n%s", R[i]);
  32. }
  33. return 0;
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
3
5 3
2 2
3 2
compilation info
prog.c: In function ‘main’:
prog.c:21:20: error: passing argument 1 of ‘strcpy’ makes pointer from integer without a cast [-Werror=int-conversion]
             strcpy(R[i], "Par");
                    ^
In file included from prog.c:3:0:
/usr/include/string.h:125:14: note: expected ‘char * restrict’ but argument is of type ‘char’
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
prog.c:26:20: error: passing argument 1 of ‘strcpy’ makes pointer from integer without a cast [-Werror=int-conversion]
             strcpy(R[i], "Impar");        }
                    ^
In file included from prog.c:3:0:
/usr/include/string.h:125:14: note: expected ‘char * restrict’ but argument is of type ‘char’
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
prog.c:31:20: error: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Werror=format=]
         printf("\n%s", R[i]);
                    ^
cc1: all warnings being treated as errors
stdout
Standard output is empty