用数组实现栈

/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 
 * @param value int整型 
 * @return 无
 *
 * C语言声明定义全局变量请加上static,防止重复定义
 */
static int stack[300];
static int top_count=0;

void push(int value ) {
    // write code here
    stack[top_count++]=value;
}

/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 
 * @param 无 
 * @return 无
 */
void pop() {
    // write code here
    top_count--;
}

/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 
 * @param 无 
 * @return int整型
 */
int top() {
    // write code here
    return stack[top_count-1];
    
}

/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 
 * @param 无 
 * @return int整型
 */
int min() {
    // write code here
    int temp=stack[0];
    for(int i=0;i<top_count;i++){
        temp=temp>stack[i]?stack[i]:temp;
    }
    return temp;
}