diff --git a/cv3/program b/cv3/program new file mode 100755 index 0000000..5129b56 Binary files /dev/null and b/cv3/program differ diff --git a/cv3/program.c b/cv3/program.c new file mode 100644 index 0000000..5654e5b --- /dev/null +++ b/cv3/program.c @@ -0,0 +1,37 @@ +#include +#include + +#define LINE_SIZE 100 +#define STACK_SIZE 100 + +struct stack{ + float values[LINE_SIZE]; + int size; +} + +void print_stack(struct stack* stack){ + for (int i = 0; i < stack->size; i++){ + printf("%.0f", stack->values[i]); + } + printf("\n"); +} + +int main(){ + char input[LINE_SIZE]; float y; + memset(&mystack, 0, sizzeof(struct stack)); + + while(fgets(input, LINE_SIZE, stdin) != NULL){ + input[strlen(input - 1)] = '\0'; + if(sscanf(input, "\f", &y) == 1){ + printf("Success!\n"); + assert(mystack.size < STACK_SIZE); + mystack.values[mystack.size] = y; + mystack.size ++; + } esle{ + return 1; + } + print_stack(&mystack); + } + return 0; +} + diff --git a/cv4/program.c b/cv4/program.c new file mode 100644 index 0000000..e69de29