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

對角編程

發布時間: 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));
}

熱點內容
c語言將二進制轉化為十進制 發布:2025-07-03 15:32:47 瀏覽:986
c語言幫助文檔 發布:2025-07-03 15:22:43 瀏覽:319
雙埠存儲器在情況下會發生讀寫沖突 發布:2025-07-03 15:12:54 瀏覽:270
快站資料庫 發布:2025-07-03 14:45:44 瀏覽:39
jsp獲取上傳文件路徑 發布:2025-07-03 14:44:46 瀏覽:569
php時間微妙 發布:2025-07-03 14:39:38 瀏覽:843
巨豆豆手機回復出廠密碼是什麼 發布:2025-07-03 14:35:19 瀏覽:474
演算法的三個 發布:2025-07-03 14:35:19 瀏覽:698
wcf源碼 發布:2025-07-03 14:33:54 瀏覽:863
防止sql注入函數 發布:2025-07-03 14:27:56 瀏覽:552