C/C++の宿題を片付けます 116代目
■ このスレッドは過去ログ倉庫に格納されています
0191デフォルトの名無しさん
2008/10/10(金) 00:59:43#include <stdio.h>
int main() {
char name[32];
int credit_standing, amount_owed, minimum_payment;
while (scanf("%31s %d %d", name, &credit_standing, &amount_owed) == 3) {
if (credit_standing > 6)
minimum_payment = (amount_owed <= 20) ? amount_owed
: (amount_owed <= 100) ? 10
: 0.1 * amount_owed;
else
minimum_payment = amount_owed;
printf("%s with credit standing %d must pay %d\n",
name, credit_standing, minimum_payment);
}
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています