當前位置:首頁 » 編程軟體 » 對角編程

對角編程

發布時間: 2023-08-06 13:46:29

『壹』 求C語言編程矩形面積周長對角線

#include "stdio.h"
//面積
double area(double len,double wid){return len*wid;}
//周長
double circle(double len,double wid){return 2*(len+wid);}
//對角線
double ijiaoxian(double len,double wid){return sqrt(len*len+wid*wid);}
void main()
{
printf("請輸入長寬:\n");
double length,width;
scanf("%f%f",&length,&width);
printf("面積為:\n",area(length,width));
printf("周長為:\n",circle(length,width));
printf("對角線長為:\n",ijiaoxian(length,width));
}

熱點內容
存儲藍盤 發布:2025-07-03 09:55:10 瀏覽:885
java必學 發布:2025-07-03 09:21:57 瀏覽:444
go在線編譯 發布:2025-07-03 09:14:51 瀏覽:19
存儲控制器hp 發布:2025-07-03 08:59:51 瀏覽:504
密碼鎖延安多少一條 發布:2025-07-03 08:58:14 瀏覽:322
linux中gcc 發布:2025-07-03 08:51:04 瀏覽:412
用什麼玩逆戰不需要配置 發布:2025-07-03 08:30:33 瀏覽:693
小雞模擬器大廳伺服器ip 發布:2025-07-03 08:19:37 瀏覽:220
linux控制面板 發布:2025-07-03 07:48:44 瀏覽:433
mysql復制資料庫及數據 發布:2025-07-03 07:39:36 瀏覽:802