#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define LOGIN 1 //denglu xitongjiemian
void interface(int i)
{
switch(i)
{
case LOGIN:
printf("
*****************************************\n");
printf("
*
1.
xueshengdenglu
*\n");
printf("
*
2.
guanliyuandenglu
*\n");
printf("
*
3.
exit
*\n");
printf("
*****************************************\n");
}
}
int main(void)
{
interface(LOGIN);
char s = getchar();
char p[16];
switch(s)
{
case '1':
printf("
*****************************************\n");
printf("
*
请输入用戶名:
*\n");
printf("
*****************************************\n");
scanf("%s", p);
char *q = getpass("input a password:");
printf("The password is: %s\n" ,q);
printf("the name is:%s\n",p);
if(strcmp(p,"fei") == 0 && strcmp(q,"1234") == 0)
printf("login success\n");
else
printf("login fail\n");
break;
case '2':printf("word\n");
}
return 0;
}