#include <bits/stdc++.h>using namespace std;
#define int long longsigned main()
{
freopen("in.txt", "r", stdin);
freopen("暴力.txt", "w", stdout);
int a, b;
cin >> a >> b;
int c = 0;
for (int i = 1; i <= a; i++) c++;
for (int i = 1; i <= b; i++) c++;
cout << c;
return 0;
}
正解程序
以下为 P1001A+BProblem 的错误正解程序
C++
#include <bits/stdc++.h>using namespace std;
#define int long longsigned main()
{
freopen("in.txt", "r", stdin);
freopen("正解.txt", "w", stdout);
int a, b;
cin >> a >> b;
cout << a + b + 1;
return 0;
}
生成程序
生成程序是用来随机生成样例的程序
以下为生成程序
C++
#include <bits/stdc++.h>using namespace std;
#define int long longint some(int mod)
{
//随机生成1到mod间的数int s = INT_MAX;
return s * rand() % mod + 1;
}
signed main()
{
freopen("in.txt", "w", stdout);
srand(time(0));
//使随机更随机int a = some(1e6);
int b = some(1e6);
cout << a << " " << b;
return 0;
}
#include <bits/stdc++.h>using namespace std;
#define int long longsigned main()
{
freopen("in.txt", "r", stdin);
freopen("正解.txt", "w", stdout);
int a, b;
cin >> a >> b;
cout << a + b ;
return 0;
}