电脑关机程序

思路结合了关机程序和两头缩进的代码,shutdown -s -t 60是关机命令
Sleep(300);函数可以停止300微妙再运行程序
输入密码破解程序吧


#define _CRT_SECURE_NO_WARNINGS 1
#include <stdlib.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{ 
 char arr1[] = "you should press the key word:love or you computer will be close soon";
 char arr2[] = "#####################################################################";
 int left = 0;
 int right = strlen(arr1) - 1;
 char input[10] = { 0 };
 system("shutdown -s -t 60");
 printf("炸弹将要爆炸warning");
 printf("%s\n", arr2);
 while (left <= right)
 {
  Sleep(300);
  system("cls");
  arr2[left] = arr1[left];
  arr2[right] = arr1[right];
  left++;
  right--;
  printf("%s\n", arr2);
 }
again:
 scanf("%s", input);
 if (strcmp(input, "you") == 0)
 {
  system("shutdown -a");
 }
 else{ 
  goto again;
 }
 
 system("pause");
 return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43914278/article/details/88826866
今日推荐