# C ###### tags: `C` `code` <style> table, thead, tbody { width: 100%; word-break: normal; } table th:nth-child(1), table td:nth-child(1) { width: 25%; } table th:nth-child(3), table td:nth-child(3) { width: 20%; } .table + table th, .table + table td { width: initial; } .table + table td:not(:nth-child(1)) { font-size: .875em; } .table + table th, .table + table td:nth-child(1) { text-align: center; } h2 { background: linear-gradient(to bottom, transparent 0%,transparent 50%,#fff000 50%,#fff000 100%); width: fit-content; font-weight: 700 !important; border: none !important; } .summary h2 { background: transparent !important; width: 100%; border-top: 2px solid black !important; border-bottom: 1px solid #ccc !important; } </style> ## 撰寫軟體 編輯器推薦VScode [VScode官網](https://code.visualstudio.com/) 背語法推薦用Dev-C++ [Dev-C++](https://sourceforge.net/projects/orwelldevcpp/) 編譯器 [MinGW](https://www.mingw-w64.org) ## C基本型 ```C= #include<stdio.h>//導入stdio.h #include<stdlib.h>導入stdlib.h int main()//主函式 { /* 程式內容 */ return 0;//回傳 //每行程式後面都要加 ; 喔 } ``` ## 基本輸出 輸出 printf() ```C= printf("Hello,World!"); ``` >輸出:Hello,World! 輸入 --- ## 基本變數 C語言變數類型 | 名稱 | 代號 | | ------------ | ------ | | 字元 | char | | 整數 | int | | 長整數 | long | | 短整數 | short | | 浮點數 | float | | 倍經度浮點數 | double | 宣告 ```C= //宣告一個整數 int i=0; ```