#include
using namespace std;
int a[100000] = { 6, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
int f(int b) {
int s = 0; while (b != 0) { s += a[b % 10]; b /= 10; } return s;
}
int l = 0;
int main() {
freopen("B.in", "r", stdin); freopen("B.out", "w", stdout); int n; cin >> n; for (int i = 10; i <= 2000; i++) { a[i] = f(i); } for (int c = 0; c <= 1000; c++) { for (int u = 0; u <= 1000; u++) { if (a[c] + a[u] + a[c + u] == n - 4) { l++; } } } cout << l; return 0;
怎么做
共 2 条回复
#include
using namespace std;
int a[100000] = { 6, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
int f(int b) {
}
int l = 0;
int main() {
}
怎么做