fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4. int maxsize=100;
  5. static char arr[100];
  6. int top=-1;
  7. char queue[100];
  8. int front=-1;
  9. int rear=-1;
  10. char enqueue(char data){
  11. if(rear+1>=100){
  12. return 0;}
  13. else{
  14. queue[rear+1]=data;
  15. rear++;
  16. return 1;
  17. }}
  18. char dequeue(){
  19. if(front==rear){
  20. return 0;}
  21. else{
  22. char data=queue[front+1];
  23. front++;
  24. return(data);
  25. }}
  26.  
  27. void push(char new){
  28. if(top==maxsize-1){
  29. printf("full stack\n");
  30. }
  31. else{
  32. top++;
  33. arr[top]=new;
  34. }}
  35. char pop(){
  36.  
  37. char tmp;
  38. if(top==-1){
  39. printf("empty");
  40. return tmp;
  41. }
  42. else{
  43. top--;
  44. return (arr[top+1]);
  45. }}
  46. int main(){
  47. int t=1;
  48. int f=0;
  49.  
  50. char stack;
  51. char queue;
  52.  
  53. char aa[100];
  54. int stringsize=strlen(aa);
  55.  
  56. int i=0;
  57. int counter=0;
  58. scanf("%d\n",&counter);
  59. for(int k=0;k<=counter;k++){
  60. scanf("%c\n",aa);
  61. while(i<stringsize){
  62.  
  63.  
  64. push(aa[i]);
  65. enqueue(aa[i]);
  66. i++;}
  67. for(int i = 0; i < stringSize; i++)
  68. {
  69. stack = pop();
  70. queue = dequeue();
  71. if(i == stringSize-1)
  72. {
  73. printf("%d\n",t);
  74. }
  75. else if(stack != queue)
  76. { printf("%d\n",f);
  77.  
  78. }
  79. }}
  80. return 0;}
  81.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:67: error: ‘stringSize’ undeclared (first use in this function)
prog.c:67: error: (Each undeclared identifier is reported only once
prog.c:67: error: for each function it appears in.)
stdout
Standard output is empty