This commit is contained in:
Your Name 2025-10-16 02:19:57 +02:00
parent 37cc0185d8
commit d52244cd22

View File

@ -87,10 +87,8 @@ int main()
struct stack mystack; struct stack mystack;
memset(&mystack,0,sizeof(struct stack)); memset(&mystack,0,sizeof(struct stack));
char input[1000]; char input[1000];
int no_in=0;
while (fgets(input,sizeof(input),stdin)!=NULL) while (fgets(input,sizeof(input),stdin)!=NULL)
{ {
no_in=1;
int flag=switch_operators(input); int flag=switch_operators(input);
input[strcspn(input,"\n")]=0; input[strcspn(input,"\n")]=0;
if (strlen(input)==0 || input[0]==' ') if (strlen(input)==0 || input[0]==' ')
@ -111,10 +109,9 @@ int main()
} }
print_stack(&mystack); print_stack(&mystack);
} }
if(!no_in) if (mystack.size == 0) {
{ printf("no input\n");
printf("no input"); }
}
return 0; return 0;
} }