#include <stdio.h>
int main() {
// 定義變數
float d, w, h, surface_area, volume;
// 提示用戶輸入長方體的長、寬、高
// 計算表面積
surface_area = 2 * (d * w + d * h + w * h);
// 計算體積
volume = d * w * h;
// 輸出結果
printf("長方體的表面積是: %.2f\n", surface_area
); printf("長方體的體積是: %.2f\n", volume
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIC8vIOWumue+qeiuiuaVuAogICAgZmxvYXQgZCwgdywgaCwgc3VyZmFjZV9hcmVhLCB2b2x1bWU7CgogICAgLy8g5o+Q56S655So5oi26Ly45YWl6ZW35pa56auU55qE6ZW344CB5a+s44CB6auYCiAgICBwcmludGYoIuiri+i8uOWFpemVt+aWuemrlOeahOmVtyAoZCk6ICIpOwogICAgc2NhbmYoIiVmIiwgJmQpOwogICAgcHJpbnRmKCLoq4vovLjlhaXplbfmlrnpq5TnmoTlr6wgKHcpOiAiKTsKICAgIHNjYW5mKCIlZiIsICZ3KTsKICAgIHByaW50Zigi6KuL6Ly45YWl6ZW35pa56auU55qE6auYIChoKTogIik7CiAgICBzY2FuZigiJWYiLCAmaCk7CgogICAgLy8g6KiI566X6KGo6Z2i56mNCiAgICBzdXJmYWNlX2FyZWEgPSAyICogKGQgKiB3ICsgZCAqIGggKyB3ICogaCk7CgogICAgLy8g6KiI566X6auU56mNCiAgICB2b2x1bWUgPSBkICogdyAqIGg7CgogICAgLy8g6Ly45Ye657WQ5p6cCiAgICBwcmludGYoIumVt+aWuemrlOeahOihqOmdouepjeaYrzogJS4yZlxuIiwgc3VyZmFjZV9hcmVhKTsKICAgIHByaW50Zigi6ZW35pa56auU55qE6auU56mN5pivOiAlLjJmXG4iLCB2b2x1bWUpOwoKICAgIHJldHVybiAwOwp9Cg==