#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
int x;
re:
cout<<"請輸入年齡";
cin>>x;
if(x<=3){
cout<<"幼童票,免費入場!"<<endl;
}
else if(x<=12){
cout<<"購買兒童票(50元)!"<<endl;
}
else if(x<=64){
cout<<"購買一般票(100元)!"<<endl;
}
else if(x>64&&x<100){
cout<<"購買敬老票(70元)!"<<endl;
}
else{
cout<<"別鬧了!"<<endl;
}
goto re;
system ("pause");
return 0;
} |