Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
168528 | 万曜诚 | 被限制的加法 | C++ | 解答错误 | 58 | 0 MS | 248 KB | 368 | 2024-08-20 11:20:37 |
#include <bits/stdc++.h> using namespace std; int main() { int n,a[110],b[110],x = 0,y = 0,l = 1,ans; cin >> n; for(int k = 1;k <= n;k++) { l = l * 10; } for(int i = 0;i < n;i++) { cin >> a[i] >> b[i]; } for(int j = 0;j < n;j++) { x = x + a[j]*l; y = y + b[j]*l; l = l / 10; } ans = x + y; cout << ans / 10; return 0; }