题解 | 小红的“质数”寻找
小红的“质数”寻找
https://www.nowcoder.com/practice/0b98a50ea30e4a3a9fe08a46eeb5f7fc
#include <iostream> #include <vector> using namespace std; vector<string> ans = {"2", "3", "5", "5", "7", "7", "12", "12", "12"}; void solve() { string str; cin >> str; int l = str.length(); int j = str[0] - '0' - 1; string s(l - 1, '0'); cout << ans[j] + s << endl; } int main() { int T; cin >> T; while (T--) { solve(); } return 0; } // 64 位输出请用 printf("%lld")