恶心的输入输出。
重要的是,明天就会有一场市级比赛,大概率会考输入输出规范化。
#include<bits/stdc++.h>
#define int long long
using namespace std;
string s1[114514];
int get_len(int n)
{
int ans = 0;
while (n)
{
n /= 10;
ans++;
}
return ans;
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
string s;
int lines = 0, temp = 0, ge = 0;
//cin.ignore();
while (getline(cin, s))
{
s1[lines++] = s;
}
int len = lines;
int i, j;
cout << " ";
for (i = 0; i < len; i++)
{
/*if (i < 10)
{
for (j = log10(len); j >= 0; j--)
{
cout << " ";
}
}
else if (i >= 10 && i < 100)
{
if (i == 10)
{
for (j = log10(i) - 1; j >= 1; j--)
{
cout << " ";
}
}
else
{
for (j = log10(i); j >= 1; j--)
{
cout << " ";
}
}
}*/
int t1 = get_len(len), t2 = get_len(i);
for (j = 1; j <= t1 - t2; j++)
{
cout << " ";
}
cout << i + 1 << " " << s1[i] << "\n";
}
return 0;
}