main()
{ int tim,i;
char f;
for(i=0;i<=1;i++)
sleep(1);
system("cd..");
system("shutdown -s");
printf("input G to cold down\n");
f=getch();
if(f=='g'||f=='G')
system("shutdown -a");
else
printf("there is no chance!\n");
getch();
}
main()
{ int tim,i;
char f;
for(i=0;i<=1;i++)
sleep(1);
system("cd..");
system("shutdown -s");
printf("input G to cold down\n");
f=getch();
if(f=='g'||f=='G')
system("shutdown -a");
else
printf("there is no chance!\n");
getch();
}
main()
{ int tim,i;
char f;
for(i=0;i<=1;i++)
sleep(1);
system("cd..");
system("shutdown -s");
printf("input G to cold down\n");
f=getch();
if(f=='g'||f=='G')
system("shutdown -a");
else
printf("there is no chance!\n");
getch();
}
如果输入非 G或g的字符就要关机 = =~