谢谢~
#include <bits/stdc++.h>
using namespace std;
const int N = 2e4 + 5;
string str[N];
int cnt;
int t, pos;
int lim;
bool f = 0;
string sp[] = {"", " ", " ", " ", " ", " "};
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
while(getline(cin, str[++cnt])){
;
}
t = cnt;
while(t){
pos++;
t /= 10;
}
lim = min(10, cnt);
for(int i = 1; i < lim; i++) cout << sp[pos - 1] << i << " " << str[i] << endl;
lim = min(100, cnt);
for(int i = 10; i < lim; i++) cout << sp[pos - 2] << i << " " << str[i] << endl;
lim = min(1000, cnt);
for(int i = 100; i < lim; i++) cout << sp[pos - 3] << i << " " << str[i] << endl;
lim = min(10000, cnt);
for(int i = 1000; i < lim; i++) cout << sp[pos - 4] << i << " " << str[i] << endl;
lim = min(20005, cnt);
for(int i = 10000; i < lim; i++) cout << sp[pos - 5] << i << " " << str[i] << endl;
return 0;
}