Initializacia
This commit is contained in:
parent
a1242f315f
commit
223d9acafb
@ -1,5 +1,8 @@
|
|||||||
#include<stdio.h>
|
#include<stdio.h>
|
||||||
#include<stdlib.h>
|
#include<stdlib.h>
|
||||||
|
#include<string.h>
|
||||||
|
#include<ctype.h>
|
||||||
|
#include<assert.h>
|
||||||
|
|
||||||
#define LINE_SIZE 100
|
#define LINE_SIZE 100
|
||||||
#define STACK_SIZE 100
|
#define STACK_SIZE 100
|
||||||
@ -17,8 +20,8 @@ void print_stack(struct stack* stack){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
char input[LINE_SIZE]; float y;
|
char input[LINE_SIZE]; float y; struct stack mystack;
|
||||||
memset(&mystack, 0, sizzeof(struct stack));
|
memset(&mystack, 0, sizeof(struct stack));
|
||||||
|
|
||||||
while(fgets(input, LINE_SIZE, stdin) != NULL){
|
while(fgets(input, LINE_SIZE, stdin) != NULL){
|
||||||
input[strlen(input - 1)] = '\0';
|
input[strlen(input - 1)] = '\0';
|
||||||
@ -27,7 +30,7 @@ int main(){
|
|||||||
assert(mystack.size < STACK_SIZE);
|
assert(mystack.size < STACK_SIZE);
|
||||||
mystack.values[mystack.size] = y;
|
mystack.values[mystack.size] = y;
|
||||||
mystack.size ++;
|
mystack.size ++;
|
||||||
} esle{
|
} else{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
print_stack(&mystack);
|
print_stack(&mystack);
|
||||||
|
Loading…
Reference in New Issue
Block a user