常量
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;
}