跪求一个:c语言密码验证程序的源代码

来源:百度知道 编辑:UC知道 时间:2024/05/19 04:51:55

#include<stdio.h>
#include<conio.h>
#include<string.h>
char password[10]="hunter";
typedef struct
{
char data[6];
int top;
}stacktype;
void initstack(stacktype *s)
{
s->top=-1;
}
void push(stacktype *s,char x)
{
if(s->top==6)
printf( "stack is full");
else
{
s->top++;
s->data[s->top]=x;
}
}
int pop(stacktype *s)
{
if(s->top==-1) return(0);
else s->top--;return(1);
}
char stacktop(stacktype *s)
{
char x;
if(s->top==-10) return(0);
else x=s->data[s->top];return(x);
}
void programme(stacktype *s)
{
char a;
char b[5];
int i,j,c;
printf( "请输入一个六位数的密码,你只有三次机会:\n");
for(i=0;i&l