📜  C++ 生成随机字母 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:49.980000             🧑  作者: Mango

代码示例1
#include 

int main() {
    srand(time(0));
    std::cout <<"random uppercase = " << char('A' + rand() % 26) << std::endl;
    // or
    std::cout <<"random uppercase = " << char('a' + rand() % 26) << std::endl;
}