初衷是让这个程序能检测游戏进程并关闭进程,但代码敲着敲着。。。嘿嘿嘿,看看代码你就知道怎么了。当然,最简单的方法还是跑一下。
/*************************
*xueba system *
* by:ZCB*
*************************/
#include<stdio.h>
#include <windows.h>
#include <stdlib.h>
int main(void)
{
double a = 0;
int b = 4;
int c = 0;
printf("Please input the public key.");
printf("\nTips:\n1.The public key is Zhu's QQ number.\n2.Your computer will be turned off if you put wrong key 5 times.\n");
scanf("%lf",&a);
if(a != 763798866)
{
printf("\nYour public key is wrong.\n");
while(b >= 1&&a != 763798866)
{
printf("\nYou now have %d chances left.",b);
printf("\nPlease try again.\n");
fflush(stdin);
scanf("%lf",&a);
b--;
}
}
if(b == 0&&a != 763798866)
{
printf("Please ask for the correct key.\n");
printf("Now your computer will be turned off in 60 seconds.\n");
system("shutdown -s -t 60");
}
else
{
printf("\nIt's the correct key.");
printf("\nThe system is activating,please wait a moment...\n");
do
{
printf("%d percent completed.\r",c);
Sleep(500);
c++;
}
while(c <= 100);
printf("\nThe system is activated successfully.\n");
printf("Please wait 5 seconds.\n");
Sleep(5000);
printf("You know,only if away from your computer can you concentrate on leaning.\nSo in order to make you become a xueba,I will turn it off.\n");
printf("O(∩_∩)O\n");
system("shutdown -s -t 60");
}
system("pause");
return 0;
}