专栏文章

对拍

科技·工程参与者 1已保存评论 0

文章操作

快速查看文章及其快照的属性,并进行相关操作。

当前评论
0 条
当前快照
1 份
快照标识符
@mir2sso9
此快照首次捕获于
2025/12/04 14:49
3 个月前
此快照最后确认于
2025/12/04 14:49
3 个月前
查看原文
CPP
对拍.cpp
#include<bits/stdc++.h>
using namespace std;
int main() {
    while(1) {
        system("ans.cpp");
        system("wa.cpp");
        system("std.cpp");
        if (system("fc wa.out std.out")) {
            break;
        }
    }
    return 0;
}
CPP
std.cpp
#include<bits/stdc++.h>
using namespace std;
int main() {
    freopen("ans.in", "r", stdin);
    freopen("std.out", "w", stdout);
    int a, b;
    cin >> a >> b;
    cout << a + b << "\n";
    return 0;
}
CPP
ans.cpp
#include<bits/stdc++.h>
using namespace std;
int main() {
    freopen("ans.in", "w", stdout);
    int flag = (rand()%100+1) == 1 ? -1 : 1;
    int a = flag * rand() % 1000 + 1;
    int b = rand() * 1000 + 1;
    cout << a << " " << b;
    return 0;
}
CPP
wa.cpp
#include<bits/stdc++.h>
using namespace std;
int main() {
    freopen("ans.in", "r", stdin);
    freopen("wa.out", "w", stdout);
    int a, b;
    cin >> a >> b;
    cout << abs(a + b) << "\n";
    return 0;
}

评论

0 条评论,欢迎与作者交流。

正在加载评论...