Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1284
Coin Exchange Problems
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 2064 accepted submission (s): 1095
Problem description has only one cent, two cent, and three cent coins in a country. There are many exchange methods to convert money N into coins. Compile Program Calculate the total number of exchange methods.
Each input row has only one positive integer N, and N is less than 32768.
Output corresponds to the number of exchange methods for each input.
Sample input2934
12553
Sample output718831
13137761
Authorsmallbeer (CRF)
Source hangdian ACM training team training competition (VII)
Recommendlcy
# Include <stdio. h> int main () {int N, sum, I; while (scanf ("% d", & N )! = EOF) {int T = N/3 + 1; // sum = 0; for (I = 0; I <t; I ++) {sum + = (n-I * 3)/2 + 1;} printf ("% d \ n", sum) ;}return 0 ;}
Don't think too complicated ~~~~~