This commit is contained in:
Your Name 2025-10-16 02:16:09 +02:00
parent 5aec2e1989
commit 37cc0185d8

View File

@ -87,9 +87,10 @@ 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 count=0; 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]==' ')
@ -109,7 +110,11 @@ int main()
push_stack(&mystack,num); push_stack(&mystack,num);
} }
print_stack(&mystack); print_stack(&mystack);
} }
if(!no_in)
{
printf("no input");
}
return 0; return 0;
} }