CCF CSP题解:坐标变换(其一)(202309-1)

链接

OJ链接:传送门

AC代码

#include <iostream>

using namespace std;

int n, m;

int dx = 0, dy = 0;

int main() {
    
    
    cin >> n >> m;
    for (int i = 0; i < n; ++i) {
    
    
        int x, y;
        cin >> x >> y;
        dx += x;
        dy += y;
    }

    for (int i = 0; i < m; ++i) {
    
    
        int x, y;
        cin >> x >> y;
        cout << x + dx << " " << dy + y << endl;
    }

    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_46655675/article/details/133781368