C/C++の宿題を片付けます 116代目 at TECH
[2ch|▼Menu]
191:デフォルトの名無しさん
08/10/10 00:59:43
>>184 なんだCだったか
#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;
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4441日前に更新/366 KB
担当:undef