void test(char *p,double e,int a){
if(*p>='0' && *p<='9'){throw *p;}
if(e<0 || e>20000) {throw e;}
if(a<18 || a>70) {throw a;}
}
int main(){
char password[8];
double earnings;
int age;
cout << "input password,earnings,age," << endl;
cin >> password >> earnings >> age;
try{
test(password,earnings,age);
}
catch(char s)
{
cout << "password error," << s << endl;
cout << "reinput password:" ;
cin >> password;
test(password,earnings,age);
}
catch(double e)
{cout << "earnings error," << e << endl;}
catch(int a)
{cout << "age error," << a << endl;}
return 0;
}
if(*p>='0' && *p<='9'){throw *p;}
if(e<0 || e>20000) {throw e;}
if(a<18 || a>70) {throw a;}
}
int main(){
char password[8];
double earnings;
int age;
cout << "input password,earnings,age," << endl;
cin >> password >> earnings >> age;
try{
test(password,earnings,age);
}
catch(char s)
{
cout << "password error," << s << endl;
cout << "reinput password:" ;
cin >> password;
test(password,earnings,age);
}
catch(double e)
{cout << "earnings error," << e << endl;}
catch(int a)
{cout << "age error," << a << endl;}
return 0;
}