常量
1.三目运算词
三字母词 | 表达字符 |
---|---|
???( | [ |
??) | ] |
??< | { |
??> | } |
2.循环
1).数组元素以及变量在内存中的分配顺序
2)goto语句应用
//电脑关机程序
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
int main()
{
char input[10] = { 0 };
flag:
system("shutdown -s -t 60");
printf("电脑将在1分钟关机,如果输入我是猪,就取消关机\n");
scanf("%s", input);
if (0 == (strcmp(input, "我是猪")))
{
system("shutdown -s");
}
else
{
goto flag;
}
return 0;
}