C/C++の宿題を片付けます 116代目at TECH
C/C++の宿題を片付けます 116代目 - 暇つぶし2ch191:デフォルトの名無しさん
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