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

链接

OJ链接:传送门

AC代码

#include 

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

你可能感兴趣的:(CCF,CSP,算法与数据结构,算法,CCF,CSP,数据结构,c++,c语言)