思路 随机生成一个只包含小写(或大写)字母的字符串先确定字符串的长度,再生成字符串 整体框架 void getRandomString(int length,char *ouput) { for(int i=0; i<length; i++) { int res=rand()%26; ouput[i]='a'+res; } ouput[length]='\0'; }