能力值:
( LV2,RANK:10 )
|
-
-
2 楼
支持一个,
|
能力值:
( LV9,RANK:170 )
|
-
-
3 楼
nerin
GllMG
|
能力值:
( LV13,RANK:410 )
|
-
-
4 楼
差不多这样了吧。
由于程序是DEBUG模式编译的。所以代码就按DEBUG来写了,实际上还是可以优化的……
char switchChar(char ch)
{
char result;
char a[]="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
char b[]="NOeTdRiosNFzKWkxZYbwnpnjCmrvqVfkgLBhGIDQlIWJMzErxGkSBlyXH[3FAj";
int i=0;
while (a[i]!=ch)
{
i++;
}
result=b[i];
retn result;
}
void main()
{
char str_username[30]={0};
int str_username_len;
char str_usercode[30]={0};
Label1:
printf "\n用户名不得小于5个字符";
printf "\n\n\n请输入用户名:";
scanf "%s",str_username;
str_username_len = lstrlen(str_username);
if (str_username_len<5 || str_username_len>=30)
{
printf "\n\n\n用户名字数不在指定的范围内";
sleep(1000);
system("cls");
goto Label1;
}
system("cls");
printf "\n用户名不得小于5个字符";
printf "\n\n\n请输入用户名:%s",str_username;
printf "\n用户码:";
scanf "%s",str_usercode;
char swithed_username[30]={0};
for (int index=0;index<=str_username_len;index++)
{
char ch=*(str_username+index);
ch = switchChar(ch);
switched_username[index]=ch;
}
int successCount=0;
for (int index=0;index<=str_username_len;index++)
{
if (switched_username[index]==*(str_username+index) successCount++;
}
(successCount==str_username_len)?printf"\n密码正确\n":printf"\n密码错误\n";
sleep(1000);
system("cls");
}
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
怎么弄的呀
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
学习学习
努力成为会员
|
|
|