题解 | 小红的“质数”寻找
小红的“质数”寻找
https://www.nowcoder.com/practice/0b98a50ea30e4a3a9fe08a46eeb5f7fc
#include <bits/stdc++.h>
#define ll long long
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int d[]={-1,2,3,5,5,7,7,11,11,11};
int T;
string s;
signed main() {
IOS
cin >> T;
while(T--) {
cin >> s;
cout << d[s[0]-'0'] << string(s.size()-1,'0') << '\n';
}
return 0;
}
查看29道真题和解析