lal
This commit is contained in:
parent
5e7e41928a
commit
6b136feceb
@ -12,7 +12,7 @@ struct stack{
|
|||||||
};
|
};
|
||||||
void print(struct stack *s)
|
void print(struct stack *s)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < s ->values[i]; i++){
|
for(int i = 0; i < s->size; i++){
|
||||||
printf("%.2f ", s->values[i]);
|
printf("%.2f ", s->values[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@ -36,7 +36,10 @@ int main(){
|
|||||||
|
|
||||||
while(fgets(x, 100, stdin)){
|
while(fgets(x, 100, stdin)){
|
||||||
x[strcspn(x, "\n")] = 0;
|
x[strcspn(x, "\n")] = 0;
|
||||||
if (strlen(x) == 0) continue;
|
if (strlen(x) == 0) {
|
||||||
|
print(&mystack);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
char *endptr;
|
char *endptr;
|
||||||
float num = strtof(x, &endptr);
|
float num = strtof(x, &endptr);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user