题解:P12154 [蓝桥杯 2024 省 Java B] 逃离高塔
模拟题。枚举
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans = 0;
void solve()
{
for (ll i = 1; i <= 2025; i++)
{
if (i * i * i % 10 == 3)
{
ans++;
}
}
cout << ans;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
// ll t; cin >> t; while (t--)
solve();
return 0;
}