标题:[原创]欢迎提出新方法
只看楼主
wenyong
Rank: 1
等 级:新手上路
帖 子:251
专家分:0
注 册:2005-8-9
 问题点数:0 回复次数:0 
[原创]欢迎提出新方法

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#define MAX 10
char a[MAX]="";
getpassword()
{
char c;

int count=0;

while((c=getch())!='\r')
if(c=='\b')
{
printf("\b \b");
count--;
}
else
{
a[count++]=c;
putchar('*');
}
putchar('\n');
return 0;
}

main()
{
char b[]="123";
getpassword();
if(strcmp(a,b)==0)
printf("ok");
else
printf("sorry");
getch();
}

欢迎提出新的好建议!

搜索更多相关主题的帖子: 欢迎 
2005-12-14 17:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-38153-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.998900 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved