提交时间:2024-11-09 22:27:39
运行 ID: 56237
#include<bits/stdc++.h> using namespace std; int main() { int N, ans = 0; cin >> N; for (int i = 1; i <= N; i++) { if(i == 3 || i == 7) continue; for (int j = i + 1; j <= N; j++) { if(j == 3 || j == 7) continue; for (int k = j + 1; k <= N; k++) { if(k == 3 || k == 7) continue; if(i + j + k != N) continue; //cout << i <<" "<<j <<" " <<" "<<k <<endl; ans++; } } } cout << ans; return 0; }