#include
using namespace std;
struct Node{
int x, y;
} a, b;
int main() {
cin >> a.x >> a.y;
cin >> b.x >> b.y;
Node c = mean(a,b);
cout<< c.x << " "<<c.y << endl;
return 0;
}
如何写mean函数啊小白求教
#include
using namespace std;
struct Node{
int x, y;
} a, b;
int main() {
cin >> a.x >> a.y;
cin >> b.x >> b.y;
Node c = mean(a,b);
cout<< c.x << " "<<c.y << endl;
return 0;
}
如何写mean函数啊小白求教
Node& mean(Node a, Node b)
{
Node r;
r.x = (a.x + b.x) /2;
r.y = (a.y+b.y) / 2;
return r;
}