返回题解分享
讨论 / 题解分享/ 帖子详情

卷王 - 题解

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    int a[3][n];

    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> a[i][j];
        }
    }
    
    int tt = 0, xm = 0;
    for (int i = 0; i < n; ++i) {
        tt += a[0][i] * a[1][i];
        xm += a[0][i] * a[2][i];
    }

    if (tt > xm) {
        cout << "ke";
    } else if (tt == xm) {
        cout << "same";
    } else {
        cout << "do";
    }
}
0 回复 0 转发 0 喜欢 2 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!