Problem Description
Given some Chinese Coins (硬币) (three kinds-- 1, 2, 5), and their number is num_1, num_2 and num_5 respectively, please output the minimum value that you cannot pay with given coins
1 1 3 0 0 0
4
#include<stdio.h> int main() { int i, j, k, a, b, c; while(scanf("%d%d%d", &a, &b, &c) != EOF && (a || b || c)) { int len = 0; if(a == 0) len = 0; else { len = a + 2 * b; if( len >= 4) len += 5*c; } printf("%d\n", len+1);//+1是它永远无法弥补的 } return 0; }