fork download
  1. # include <stdio.h>
  2. # include <string.h>
  3. # include <stdlib.h>
  4. char stack[50];
  5. int top=-1;
  6. int push(char elem)
  7. {
  8. if(top<50)
  9. {
  10. top++;
  11. stack[top]=elem;
  12. return(1);}
  13. else {return 0;}
  14. }
  15. char pop()
  16. {
  17. if(top==-1)
  18. {
  19. return(0);}
  20. else{
  21. return(stack[top--]);
  22. }
  23. }
  24. int main()
  25. {int N;char arr[50];
  26. int count=0;
  27. int n;
  28. scanf("%i",&N);
  29. int k;
  30. for(k=0;k<N;k++)
  31. {
  32. scanf("%s",&arr);
  33. int length=strlen(arr);
  34. int i;
  35. for(i=0;i<length;i++)
  36. {
  37. char x=arr[i];
  38. push(x);
  39. }
  40. int j;
  41. char y[50];
  42. for(j=0;j<length;j++)
  43. {
  44. y[j]=pop();}
  45. for(n=0;n<length;n++)
  46. {if(arr[n]==y[n]){
  47. count++;}}
  48. if(count==length)
  49. {printf("1\n");}
  50. else{printf("0\n");
  51. }
  52. }
  53.  
  54. return(0);
  55. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
cc1: warnings being treated as errors
prog.c: In function ‘main’:
prog.c:32: error: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[50]’
stdout
Standard output is empty