标签:scan printf algo main style code amp name str
/* */ #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int c1[121], c2[121]; void init() { for (int i = 0; i <= 120; i++) { c1[i] = 1; c2[i] = 0; } for (int i = 2; i <= 120; i++) { for (int j = 0; j <= 120; j++) { for (int k = 0; k+j <= 120; k+=i) { c2[k+j] += c1[j]; } } for (int j = 0; j <= 120; j++) { c1[j] = c2[j]; c2[j] = 0; } } } int main() { int n; init(); while (scanf("%d", &n) != EOF) { printf("%d\n", c1[n]); } }
标签:scan printf algo main style code amp name str
原文地址:http://www.cnblogs.com/a863886199/p/7818953.html