Files
python/TangDou/LanQiaoBei/LanQiaoBeiWhitePaper/6_ThreeNumberCount.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

15 lines
393 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <bits/stdc++.h>
using namespace std;
int n, cnt;
int main() {
cin >> n;
for (int i = 1; i <= n; i++)//首位不能是0
for (int j = 0; j <= n; j++)//二位可以是0
for (int k = 1; k <= n; k += 2) //三位必须是奇数,1,3,5,7,...
if (k != i && k != j && i != j) cnt++;
cout << cnt << endl;
return 0;
}