This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define PI 3.1415926 //C語言沒有pi的定義,所以我們要自己定義一個pi,要用到的時候不用再打3.14 | |
| #include <math.h> //裡面用到pow還有sqrt所以要引用 | |
| #include <stdio.h> //基本的函數 | |
| int main(){ | |
| float perimeter = 0; //perimeter是周長的英文,你要用別的也可以 | |
| printf("輸入周長,分別計算正方形、正三角形和圓形面積:"); |