C++程序填空题怎么搞,求解

这个程序填空怎么搞?


#include <iostream>
using namespace std;

enum ERROR{UnderFlow,OverFlow};
template<typename T>
class StackTemplate {
    enum { ssize = 100 };
    T stack[ssize];
    int top;
public:
    StackTemplate() : top(0) {}
    void push(const T& i) {
        if (top >= ssize)  
;
        stack[top++] = i;
    }
    T pop() {
        if (
) throw UnderFlow;
        return 
;
    }
    int size() const
    { return top; }
};
int fibonacci(int n);

int main() {
    
 {
        
 is;
        for(int i = 0; i < 20; i++)
            is.push(fibonacci(i));
        for(int k = 0; k < 20; k++)
            cout << is.pop() << "\t";
    }
    catch( ERROR e ) {
        switch(
)
        {
        case OverFlow:
            exit;
        case UnderFlow:
            exit;
        }
    }
    catch(...)
    {
        exit;
    }
    return 0;
}

int fibonacci(int n) 
{
    
 int sz = 100;
    int i;
    static int f[sz]; 
    if (n >= sz) 
;
       f[0] = f[1] = 1;
    for(i = 0; i < sz; i++)
        if(f[i] == 0) break;
    while(i <= n) {
        
 = f[i-1] + f[i-2];
        i++;
    }
    return 
;
}


#include
using namespace std;

enum ERROR{UnderFlow,OverFlow};
template
class StackTemplate {
enum { ssize = 100 };
T stack[ssize];
int top;
public:
StackTemplate() : top(0) {}
void push(const T& i) {
if (top >= ssize)
throw OverFlow; //填空1:抛出异常OverFlow
stack[top++] = i;
}
T pop() {
if (top <= 0)
throw UnderFlow; //填空2:抛出异常UnderFlow
return stack[--top]; //填空3:返回栈顶元素
}
int size() const
{ return top; }
};
int fibonacci(int n);

int main() {
try {
StackTemplate is;
for(int i = 0; i < 20; i++)
is.push(fibonacci(i));
for(int k = 0; k < 20; k++)
cout << is.pop() << "\t";
}
catch( ERROR e ) {
switch(e) //填空4:使用switch-case语句,根据错误类型输出对应错误信息
{
case OverFlow:
cout << "Stack overflow!" << endl;
exit(1);
case UnderFlow:
cout << "Stack underflow!" << endl;
exit(1);
}
}
catch(...) //填空5:捕获所有未知异常,并输出错误信息
{
cout << "Unknown exception caught!" << endl;
exit(1);
}
return 0;
}

int fibonacci(int n)
{
int sz = 100;
int i;
static int f[sz];
if (n >= sz)
throw OverFlow; //根据情况,抛出异常OverFlow
f[0] = f[1] = 1;
for(i = 0; i < sz; i++)
if(f[i] == 0) break;
while(i <= n) {
f[i] = f[i-1] + f[i-2];
i++;
}
return f[n]; //填空6:返回第n个斐波那契数
}