1.多输出最后空行
输出格式应为:
1
/n
2
/n
3
/n表示空行
而如下没有说明格式:
输出格式为
1
\n
2
\n
3
\n
2.多输出最后空格
输出格式应为
0 1 1 1 0 0 0 0 0 0
1 6 2 2 1 1 1 1 1 1
注:每行最后一个数后面不应输出空格
如果写成
for (int count : digit)
{
cout << count << ' ';
}
cout << endl;
则会presentation error
应改为
for (int i = 0; i < 10; ++i)
{
if (i == 9)
{
cout << digit[i];
}
else
cout << digit[i] << ' ';
}
cout << endl;