C/C++の宿題片付けます 129代目
■ このスレッドは過去ログ倉庫に格納されています
0897894
2009/08/09(日) 19:56:01あの、自分で
int main(){
int age, s;
printf("年齢を入力してください:");
scanf("%d", &age );
printf("性別を入力してください(男性1、女性2):");
scanf("%d", &s);
printf("入場料は%d円です\n", price(age, s));
return 0;
}
int price( int age, int s){
int result = 0;
int price;
if(age >= 15){
if(s == MALE){
price = 200;
}else{
price = 150;
}
}else if(age < 15 && age >= 5){
price = 100;
}else
price = 0;
return result;
}
と書いてみたのですが、どこがおかしいのでしょうか?何度もすみません!
■ このスレッドは過去ログ倉庫に格納されています