1、利用void类型函数
#include<iostream>
#include<math.h>
using namespace std;
int main() {
double x, y,he,gen;
cout << "请输入x的值:";
cin >> x;
cout <<"请输入y的值:";
cin >> y;
void fun(double x, double y,double *he, double* gen);
fun(x, y, &he,&gen);
cout<<"x、y的平方和是"<<he<<",x、y和的平方根是"<<gen;
return 0;
}
void fun(double x,double y, double* he,double *gen) {
*he = x * x + y * y;
*gen=sqrt(x + y);
}
2、利用double类型函数
#include<iostream>
#include<math.h>
using namespace