提交时间:2024-08-21 14:29:32
运行 ID: 50387
# include <bits/stdc++.h> using namespace std; int ans; int main(){ int f, n; cin >> f >> n; for(int i = 1; i <= f; i ++){ for(int j = 1; j <= n; j ++){ string s = to_string(i), s1; if(j < 10)s += "0"; s += to_string(j); for(int k = s.size() - 1; k >= 0; k --){ if(s[k] == '0' || s[k] == '1' || s[k] == '8')s1 += s[k]; else if(s[k] == '6')s1 += "9"; else if(s[k] == '9')s1 += "6"; else break; } if(s == s1){ ans ++; } } } cout << ans; }