15 lines
393 B
C++
15 lines
393 B
C++
|
|
#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;
|
|||
|
|
}
|