Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void multiples_entries() {
- int num;
- scanf("%d", &num);
- printf("%d ", num);
- if(num == -1000) {
- printf("\n");
- return;
- }
- else {
- int i = 0;
- char character, input[1000];
- stack *stack = create_stack();
- while(1) {
- scanf("%c", &character);
- if(character != '\0' && character != ' ') {
- input[i++] = character;
- if(character == '(') {
- push(stack, '(');
- }
- else if(character == ')') {
- pop(stack);
- if(stack -> top == NULL) {
- break;
- }
- }
- }
- }
- input[i++] = '\0';
- //int aux = 0;
- //int *j = &aux;
- //bt *bt = create_empty_binary_tree();
- //bt = read(bt, input, j);
- /*if(path(bt, num, 0)) {
- printf("sim\n");
- }
- else {
- printf("nao\n");
- }*/
- //print_pre_order(bt);
- printf("%s\n", input);
- multiples_entries();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement