Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//#define DEBUG 1
#define BLOCK_NUMBER 1000
#define MOUNTEN_NUMBER 100
#define INPUT_LENGTH 9
 
void push(char array[MOUNTEN_NUMBER][BLOCK_NUMBER + 1], int num, char *sp_2);
char pop(char array[BLOCK_NUMBER + 1], int num);
void move(char array[MOUNTEN_NUMBER][BLOCK_NUMBER + 1], int num, int mo);
void sprit(char *input, char *sw, char *in_1, char *in_2);

main()
{
	char array[MOUNTEN_NUMBER + 1][BLOCK_NUMBER + 1];
	char ans[BLOCK_NUMBER + 1];
	int ans_c = 0;
	char input[INPUT_LENGTH];
	char sw;
	char *sprit_1;
	sprit_1 = (char*)malloc( sizeof( char) * 4 );
	char *sprit_2;
	sprit_2 = (char*)malloc( sizeof( char) * 2 );
	int i, j, set_mou;
	
	scanf("%d", &set_mou);
	for(i = 0; i < set_mou; i++)
	{
		for(j = 0; j < BLOCK_NUMBER; j++)
		{
			array[i][j] = '\0';
			ans[i] = '\0';
		}
	}
	while (1)
	{	
		for(i = 0; i < INPUT_LENGTH; i++)
		{
			input[i] = '\0';
		}
		for(i = 0; i < 4; i++)
		{
			sprit_1[i] = '\0';
		}
		for(i = 0; i < 2; i++)
		{
			sprit_2[i] = '\0';
		}		
		scanf("\n");
		gets(input);
		
		if(strcmp(input, "quit") == 0)
		{
			break;
		}
		else
		{
			sprit(input, &sw, sprit_1, sprit_2);
#ifdef DEBUG
			printf("sw = %c\nin1 = %s\nin2 = %s\n",sw, sprit_1, sprit_2);
#endif

			int number = atoi(sprit_1) - 1;
			if(sw == 's')
			{
				push(array, number, sprit_2);
			}
			else if(sw == 'p')
			{
				ans[ans_c] = pop(array, number);
				ans_c++;
			}
			else if(sw == 'v')
			{
				int mo_num = atoi(sprit_2) - 1;
				move(array, number, mo_num);
			}
		}

	
	}
	for(i = 0; i < ans_c; i++)
	{
		printf("%c\n", ans[i]);
	}

	free(sprit_1);
	free(sprit_2);
	return 0;
}

void push(char array[MOUNTEN_NUMBER][BLOCK_NUMBER + 1], int num, char *sp_2)
{
	int length = strlen(array[num]);
	array[num][length] = *sp_2;
#ifdef DEBUG
	printf("array: %c\n", array[num][length]);
#endif
	
}

char pop(char array[MOUNTEN_NUMBER][BLOCK_NUMBER + 1], int num)
{
	char re_ch = '\0';
	int length = strlen(array[num]);
	re_ch = array[num][length - 1];
	array[num][length- 1] = '\0';
#ifdef DEBUG
	printf("%c\n", re_ch); 
#endif
	return re_ch;

}

void move(char array[MOUNTEN_NUMBER][BLOCK_NUMBER + 1], int num, int mo)
{
	char set_ch = pop(array, num);
	push(array, mo, &set_ch);
}

void sprit(char *input, char *sw, char *in_1, char *in_2)
{
	int i;
	*sw = input[2];
	for(i = 0; i < strlen(input); i++)
	{
		if(input[i] == ' ')
		{
			i++;
			
			while(input[i] != ' ' && input[i] != '\0')
			{
				*in_1 = input[i];
				in_1++;
				i++;
			}
			if(input[i] == ' ')
			{
				*in_2 = input[i + 1];
			}
			break;
		}
	}
}

Compiler output:
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
   15 | main()
      | ^~~~
main.c: In function 'main':
main.c:52:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   52 |                 gets(input);
      |                 ^~~~
      |                 fgets
main.c:72:50: error: passing argument 1 of 'pop' from incompatible pointer type [-Wincompatible-pointer-types]
   72 |                                 ans[ans_c] = pop(array, number);
      |                                                  ^~~~~
      |                                                  |
      |                                                  char (*)[1001]
main.c:11:15: note: expected 'char *' but argument is of type 'char (*)[1001]'
   11 | char pop(char array[BLOCK_NUMBER + 1], int num);
      |          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
main.c: At top level:
main.c:104:6: error: conflicting types for 'pop'; have 'char(char (*)[1001], int)'
  104 | char pop(char array[MOUNTEN_NUMBER][BLOCK_NUMBER + 1], int num)
      |      ^~~
main.c:11:6: note: previous declaration of 'pop' with type 'char(char *, int)'
   11 | char pop(char array[BLOCK_NUMBER + 1], int num);
      |      ^~~