#includeusing namespace std; #include #include #include void myrand(string &str,int leng) { srand(int(time(0)));//产生随机种子,保证每次的数据都不重复 char temp= '0'; for (int i = 0; i < leng; i++) { switch (rand() % 3) { case 0: temp = rand() % 10 + '0'; break; case 1: temp = rand() % 26 + 'a'; break; case 2: temp = rand() % 26 + 'A'; break; } str += temp; } } int main() { string str; myrand(str,4); cout <



