You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
case 3 : system ( " cls " ) ; //试题输入
char code1 [ 50 ] = { " jiehe " } , check1 [ 50 ] ; //输入管理员密码
printf ( " 请输入管理员密码: " ) ;
for ( j = 1 ; j < = 3 ; j + + )
{
scanf ( " %s " , check1 ) ;
getchar ( ) ;
system ( " cls " ) ;
if ( ! strcmp ( code1 , check1 ) )
{
printf ( " 密码正确 \n " ) ;
Sleep ( t ) ;
system ( " cls " ) ;
judge = 1 ;
break ;
}
else
{
printf ( " 密码输入错误,您还有%d次机会 \n " , m ) ;
m - - ;
if ( m = = 1 & & ! strcmp ( code1 , check1 ) )
{
printf ( " 密码正确 \n " ) ;
Sleep ( t ) ;
system ( " cls " ) ;
judge = 1 ;
break ;
}
if ( m = = 0 & & ! strcmp ( code1 , check1 ) )
{
printf ( " 密码正确 \n " ) ;
Sleep ( t ) ;
system ( " cls " ) ;
judge = 1 ;
break ;
}
else
judge = 2 ;
}
}
m = 2 ;
if ( judge = = 1 )
{
InputTitle ( N ) ;
}
system ( " cls " ) ;
if ( judge = = 2 )
{
while ( p > 0 )
{
printf ( " \n \n \n \n \n \n \n \n \n \n " ) ;
printf ( " \t \t \t 您可能是非法闯入! \n " ) ;
printf ( " \t \t \t 五秒后将自动返回开始界面! \n " ) ;
printf ( " \t \t \t 五秒后您可以重新输入! \n " ) ;
printf ( " \t \t \t 时间还剩%d秒 " , p ) ;
Sleep ( 1000 ) ;
system ( " cls " ) ;
p - - ;
}
}
p = 5 ;
system ( " cls " ) ;
break ;
case 4 : system ( " cls " ) ; //保存试题到文件
char c ;
if ( SaveNode ( N ) )
printf ( " 保存成功! \n " ) ;
else printf ( " 保存失败! \n " ) ;
printf ( " \n " ) ;
printf ( " 按回车返回主界面 " ) ;
scanf ( " %c " , & c ) ;
if ( c = = ' \n ' )
{
system ( " cls " ) ;
}
break ;
case 5 : system ( " cls " ) ; //退出考试系统
printf ( " 你将退出考试系统( Y or N?) \n " ) ;
scanf ( " %c " , & flag ) ;
getchar ( ) ;
if ( flag = = ' Y ' | | flag = = ' y ' )
exit ( 0 ) ;
system ( " cls " ) ;
break ;
default : system ( " cls " ) ;
printf ( " 请输入正确的选择: \n " ) ;
Sleep ( t ) ;
system ( " cls " ) ;
}
}
}