Skip to content

Instantly share code, notes, and snippets.

View SamWang8891's full-sized avatar
😀
Dealing with unnecessary problems...

SamWang8891 SamWang8891

😀
Dealing with unnecessary problems...
View GitHub Profile
#define PI 3.1415926 //C語言沒有pi的定義,所以我們要自己定義一個pi,要用到的時候不用再打3.14
#include <math.h> //裡面用到pow還有sqrt所以要引用
#include <stdio.h> //基本的函數
int main(){
float perimeter = 0; //perimeter是周長的英文,你要用別的也可以
printf("輸入周長,分別計算正方形、正三角形和圓形面積:");