版本比较
数据生成器
正文
增加 5 行删除 5 行
2 行未改动3456789101112131415161718192021222324252619 行未改动46474849505152535455562 行未改动```cpp#include <bits/stdc++.h>using namespace std;void get(){//一个可以生成输入的函数,直接赋值给变量就行。}int check(){//一个可以返回正确答案的函数,不用输入,但还是要从生成好的输入里备份一份,不然有可能会覆盖。return 0;}int len(int x){int ans = 0;while (x > 0){ans++;x /= 10;}return ans;}int main(){int k = 20;//数据数量for (int i = 1; i <= k; i++){int x = len(i);const int l = 4 + x + 4;char s1[l];19 行未改动s2[4 + x + 4] = '\0';get();int ans = check();freopen(s1, "w", stdout);//输出数据freopen(s2, "w", stdout);cout << ans << '\n'; //输出答案}return 0;}```2 行未改动3456789101112131415161718192021222324252619 行未改动46474849505152535455562 行未改动```cpp#include <bits/stdc++.h>using namespace std;void get(){//一个可以生成输入的函数,直接赋值给变量就行。}int check(){//一个可以返回正确答案的函数,不用输入,但还是要从生成好的输入里备份一份,不然有可能会覆盖。return 0;}int len(int x){int ans = 0;while (x > 0){ans++;x /= 10;}return ans;}int main(){int k = 20;//数据数量for (int i = 1; i <= k; i++){int x = len(i);const int l = 4 + x + 4;char s1[l];19 行未改动s2[4 + x + 4] = '\0';get();int ans = check();freopen(s1, "w", stdout);//输出数据freopen(s2, "w", stdout);cout << ans << '\n'; //输出答案}return 0;}```