#include<iostream>
using namespace std;
int banduan(int dx) throw(char *)
{
if(dx>10)
throw("下标越界!");
else
return f[dx];
}
void main()
{
int a;
int f[10] = {1,2,3,4,5,6,7,8,9,10};
cin>>a;
try
{
cout<<"the number is :"<<banduan( a);
}
catch(char *Errs)
{
cerr<<Errs<<endl;
}
}
帮我解下这个题哒
谢谢哈