题解 | 小红的“质数”寻找

小红的“质数”寻找

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;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务