funguje
This commit is contained in:
parent
a14288d57d
commit
240a8033ce
@ -87,6 +87,7 @@ int main()
|
||||
struct stack mystack;
|
||||
memset(&mystack,0,sizeof(struct stack));
|
||||
char input[1000];
|
||||
int count=0;
|
||||
while (fgets(input,sizeof(input),stdin)!=NULL)
|
||||
{
|
||||
int flag=switch_operators(input);
|
||||
@ -103,12 +104,16 @@ int main()
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n");
|
||||
char* ptr;
|
||||
float num=strtof(input,&ptr);
|
||||
push_stack(&mystack,num);
|
||||
}
|
||||
print_stack(&mystack);
|
||||
if(count!=2)
|
||||
{
|
||||
printf("\n");
|
||||
}
|
||||
count++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user