一、问题描述:

求房子的高度

二、设计思路:

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;
}

 

posted on 2023-04-12 20:38  标志蛋挞  阅读(22)  评论(0)    收藏  举报