美文网首页
生成随机数字+字符串

生成随机数字+字符串

作者: Jianbaozi | 来源:发表于2019-04-24 15:09 被阅读0次
#include<string>
#include<random>
#include<ctime>
using namespace std;
int main() {
    srand((unsigned)time(NULL));
    string s = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    for (int i = 0; i < 10; ++i) {
    for (int i = 0; i < 10; ++i) {
        string s2;
        s2.push_back(s[rand() % 52]);
        cout << s2;
    }
    cout << endl;
}
    system("pause");
    return 0;
}

相关文章

网友评论

      本文标题:生成随机数字+字符串

      本文链接:https://www.haomeiwen.com/subject/ldeggqtx.html