提交时间:2023-08-24 10:01:33
运行 ID: 99885
#include <bits/stdc++.h> using namespace std; int a[30] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; int main() { int n, cnt=0; cin >> n; if (n <= 4) { cout << 0 << endl; return 0; } n -= 4; for (int i = 0; i <= 9; i++) { for (int j = 0; j <= 9; j++) { int t = i + j; if (!a[t]) continue; int req = a[i] + a[j] + a[t]; if (req == n) cnt++; } } cout << cnt << endl; return 0; }