CodePudding user response:
Fyi:# include & lt; Time. H>
#include
#include
#include
Char * family="2 wang Zhang Liuchen Yang Huang Zhaowu Zhou Xu sun Zhu Hu ma guo he belt Collins Luo Zhengliang thank Song Tang xu han feng deng Cao Peng"
"Zeng Xiaotian dong pan yuan in Jiang Cai Yu Du Ye Cheng Wei Lvding ren shen su yao lu jiang Cui Zhong tan lu Wang Fan stone liao"
"Gu Xia WeiFu square white Zou Mengxiong Qiu Jiangyin qin xue yan lei duan Hou Long links Li He gu MAO hao gong yan shao wan money"
"QinWu wear mo hole to soup";
Char * boyname="wei army east ping an insurance just yong YiJunFeng Wen Hui force mingyong kin shi guang YiXingLiang seamounts rinpoche NingGuiFu born"
"Dragon yuan learn auspicious national games to send Wu Xinli qing fly together in the fushun believes JieTao son chang ChengKang starlight in the days of andesite"
"Into alum has established and puma bo cheng Lin first JingZhen vibration strong heart will think of hao bang ChengLeShao work loose good friends" thick celebration of lei people
"The yulin river zhe Jiang Chaohao bright political modest heng has solid wheel of John lambert macros if words sound friends bin. Liang Dongwei Karen xiang xu."
"Peng ze Chen Chen" and to build home tree inflammation caused by virtue Thai ShengXiongChen jun crown policy teng nan rongping wind air hong ";
Char * girlname="xiu yun ying hua hui qiao mei na jing shu hui pearls and jade, red moths ling zhi yu ping fragrance YanCai crown Daisy LanFengJie mlin"
"Elements YunLian ring can snow love sister rong XiaXiang month warbler luca brasi yan rui van jia jia Joan frequently Jane zhen li GuiDi Ye Bilu her march"
"Crystal shes alizarin autumn sansa jin dai qing qian wan d. top the xian jin YingLouYao yi chan goose page Wan meter charge danrong eyebrow jun piano works"
"Eu qingsong dream arashi YuanJieXin been reflected Yan rhyme integrating gardening chorale QingCongLan pure yu yue zhao icy wan nameplates, feather and NingXin float)"
Research relapsed narration soft maple non-success of bamboo brume coagulate XiaoHuan clouds thin cold, the appropriate to her ShuYing litchi she ";
Char * mixname="rings HuaQiuDi GuiFengXu Rena friends administration first RenChenYun elegant soft ty to appropriate NingShan acknowledge her ailing teng yan bin huan heiress Joan wan", "
"Green tree color shu hao dew wind a jeppo ping moves the whole Wan pure Jiang Yijun health flight feathers shock vibration spring every eu dragon to navigation homag xiang"
"- think Diane Kim hair bright garden, chang MAO yan army jia shadow into the bead hui lang inflammation ring permanent JiChanDan jin li yong yi maple just bud is committed
"HuiHengBao and male wan friends clouds, strong group of wise men frequently Kang Yunfeng narration yuan if Daisy thick sound enlight nan brocade art of east Asia LanYiHui"
"Mountain is guang yun qing xing Yan letter chardonnay countries ZhongQing chung ChengHan crown your speech Agnes xin QingChen heart fei yu zhi cheng yi learning rongping solid rong"
"Bo the xian bush Liang Yanmei loose crystal red YuanYanBang policy bin trishanne month gone with the wind when people zhao yi river beauty good parenting ning piece MingChen wonders"
"Will work Sally Ye Mei ice new lei" puma built of bearing wheel yao relapsed after she cold Lin Jian YingYing JingAnYan hin cheung sea mingyuan LiangYue le "
"Qi qiao xiao to bright containing d. love MeiShun strong macro raw bamboo modest qian lian yu jun si ling, true ying yun jia ping Jane Lin qin jie fu"
"Moths, jing li star super and home wei light dream coagulation Wen Fang been reflected march snow melts ShuFuLan day ze hong xu branches show Mr Zhen salt peng rong tao Aaron"
"Certainly" tuan yu;
FILE *fp;
Char TMP [2000 * (6 + 1) + 1);
Int the make (char * filename, char * BGX, int bgxnum) {
Int num, I, n, y, z;
While (1) {
Puts (" \ n note: one can generate a maximum of 2000. \ n ");
Printf (" how much are you going to generate a name? : ");
The fflush (stdout);
The rewind (stdin);
The scanf (" % d ", & amp; Num);
If (1 & lt; Num=& amp; & Num<=2000) break;
}
Fp=fopen (filename, "r");
If (fp!=NULL) {
int x;
fclose(fp);
Printf (" warning: ready to generate % s already exists! \ n ", filename);
Puts (" 1. Additional file content ");
Puts (" 2. Cover the file content ");
Puts (" 0. Cancel this operation ");
Printf (" please make a choice: ");
The fflush (stdout);
The rewind (stdin);
The scanf (" % d ", & amp; X);
The switch (x) {
Case 0:
Puts (" \ n has cancelled the operation!" );
getch();
Return (0);
break;
Case 1:
Fp=fopen (filename, "a");
If (fp==NULL) {
Printf (" additional % s file content failed! May file a read-only property or are being used!" The filename);
getch();
The return (1);
}
break;
Case 2:
Fp=fopen (filename, "w");
If (fp==NULL) {
Printf (" override file % s content failed! May file a read-only property or are being used!" The filename);
getch();
The return (1);
}
break;
Default:
Puts (" you don't have to make effective choice, press any key to return to the main menu." );
getch();
Return (0);
}
} else {
Fp=fopen (filename, "w");
If (fp==NULL) {
Puts (" failed to create file!!!!! ");
getch();
The return (1);
}
}
Y=0; Z=1;
for (i=0; iN=rand () % 100 * 2;
TMP [y]=family [n].
TMP [z]=family [n + 1);
Y +=2;
Z +=2;
N=rand () % bgxnum * 2;
TMP [y]=BGX [n].
TMP [z]=BGX [n + 1);
Y +=2;
Z +=2;
If (rand () % 2==1) {
N=rand () % bgxnum * 2;
TMP [y]=BGX [n].
TMP [z]=BGX [n + 1);
TMP [z + 1]='\ n';
Y +=3;
Z +=3;
} else {
TMP [y]='\ n';
Y++;
Z++;
}
}
TMP/z - 1='\ 0';
The fputs (TMP, fp);
fclose(fp);
Printf (" batch name is output to the file: % s ", filename);
getch();
Return (0);
}
Int main () {
Int SLT.
Srand (time (NULL));
While (1) {
Puts (" \ n batch name generator v1.0. By morning, QQ: 88072010 \ n ");
Puts (" 1. Generate man name ");
Puts (" 2. Generate griselda ");
Puts (" 3. Generate mixed name ");
Puts (" 0. Quit this program ");
Puts (" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ");
Printf (" please select: ");
The fflush (stdout);
The rewind (stdin);
The scanf (" % d ", & amp; SLT);
The switch (SLT) {
Case 1: make (" boyname. TXT ", boyname, 150); break;
Case 2: make (" girlname. TXT ", girlname, 149); break;
Case 3: make (" mixname. TXT ", mixname, 299); break;
Case 0: return 0;
Default: the continue;
}
}
}
CodePudding user response:
26 letters and 10 Numbers, the array in a S (35),As long as you control the random number n from 0 to 35, and S (n)
CodePudding user response:
Randomly generated is digital commonly, if you need to generate letters, must transform, can make use of CRH function transformation, such as the following exampleDim AA (1 To 20) As String, BB (1 To 10) As String
For I=1 To 20
AA (I)=CRH (Int (Rnd * 25 + 65)) & amp; CRH (Int (Rnd * 25 + 97)) & amp; CRH (Int (Rnd * 25 + 65)) & amp; CStr (Int (Rnd * 89 + 10))
If I Mod 5=0 Then
Text1. Text=Text1. Text & amp; AA (I) & amp; VbCrLf
The Else
Text1. Text=Text1. Text & amp; AA (I) & amp; ", "
End the If
Next I
For I=1 To 10
BB (I)=CRH (Int (Rnd * 25 + 65)) & amp; CRH (Int (Rnd * 25 + 97)) & amp; CRH (Int (Rnd * 25 + 65)) & amp; CRH (Int (Rnd * 25 + 97))
If I Mod 5=0 Then
Text2. Text=Text2. Text & amp; BB (I) & amp; VbCrLf
The Else
Text2. Text=Text2. Text & amp; BB (I) & amp; ", "
End the If
Next I
Of course, you need to modify the see how letters combination,