本帖最后由 嗨,强哥! 于 2014-8-14 11:30 编辑
[mw_shl_code=c,true]#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
int a;
int i = 0;
printf("请输入密码:");
while (i <= 3)
{
scanf("%d", &a);
if (a == 123456)
{
printf("欢迎使用!\n");
Sleep(1000);
break;
}
else
{
i++;
printf("第%d次输入错误,三次错误将自动关机!\n", i);
while (i == 3)
{
printf("系统将在60秒后自动关机!");
Sleep(1000);
system("cls");
system("shutdown -s");
}
}
printf("请输入密码:");
}
system("exit");
system ("pause");
}
[/mw_shl_code]
|