ABC106B - 105
問題:B - 105
#include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) bool getJudge(int x_n) { int cnt = 0; FOR(i, 1, x_n + 1) { if (x_n % i == 0) { cnt++; } } return cnt == 8; } int main(void) { int n, ans = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> n; FOR(i, 1, n + 1) { if (i % 2 && getJudge(i)) { ans++; } } cout << ans << "\n"; return 0; }