使用 random() 制造乱数
再转成char存入目的档中
有点小白的程式
希望有大大能教我如何使用ASCII码
这样就可以轻松的把特殊符号一起加进密码簿里... Thanks!
#include <stdio.h>
#include <stdlib.h>
void main()
{
FILE *pt;
int a,b,cnum,gnum,t;
printf("Characters of password: ");
scanf("%d",&cnum);
printf("How many passwords: ");
scanf("%d",&gnum);
pt = fopen("logs.txt","w");
for(a=0;a<gnum;a++)
{
for(b=0;b<cnum;b++)
{
fprintf(pt,"%c",charset(random(62)));
}
fprintf(pt,"\n");
}
printf("\nAll passwords are in \"logs.txt\"");
printf("\nPress any key to continue ...");
getch();
}
int charset(n)
{
char ch;
switch(n){
case 0:
ch=Ɔ'
break;
case 1:
ch=Ƈ'
break;
case 2:
ch=ƈ'
break;
case 3:
ch=Ɖ'
break;
case 4:
ch=Ɗ'
break;
case 5:
ch=Ƌ'
break;
case 6:
ch=ƌ'
break;
case 7:
ch=ƍ'
break;
case 8:
ch=Ǝ'
break;
ca ..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容