首页 > 其他分享 >房子的高度

房子的高度

时间:2023-04-12 20:44:44浏览次数:29  
标签:int pow 高度 房子 high include

一、问题描述:

求房子的高度

二、设计思路:

1、声明变量

2、输入地球的半径和房顶到太平洋的距离

3、计算房子的高度

4、输出房子的高度

三、流程图:

 

四、代码实现:

#include <iostream>
#include <math.h>
using namespace std;
int main(){
int r,d,high;
cin>>r>>d;
high=sqrt(pow(r,2)+pow(d,2))-r;
cout<<high;
return 0;
}

 

标签:int,pow,高度,房子,high,include
From: https://www.cnblogs.com/lzh0416/p/17311174.html

相关文章