1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】13.指针1/6-3 求两数平方根之和.md

37 lines
713 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 6-3 求两数平方根之和
函数fun的功能是求两数平方根之和作为函数值返回。例如输入12和20输出结果是y = 7.936238。
### 函数接口定义:
```c++
double fun (double *a, double *b);
```
其中 `a `和 `b `是用户传入的参数。函数求 `a `指针和` b` 指针所指的两个数的平方根之和,并返回和。
### 裁判测试程序样例:
```c++
#include<stdio.h>
#include <math.h>
double fun (double *a, double *b);
int main ( )
{ double a, b, y;
scanf ("%lf%lf", &a, &b );
y=fun(&a, &b); printf ("y=%.2f\n", y );
return 0;
}
/* 请在这里填写答案 */
```
### 输入样例:
```in
12 20
```
### 输出样例:
```out
y=7.94
```