问题链接:https://vjudge.net/problem/HDU-6292
Point:在输入第三行时,若m=0,则此行为空行。意思是不输入,不用再输出一个空行。
AC代码:
#include <iostream>
using namespace std;
int main()
{
int i,T,n,m,a,b,s=65536,t=65536;
cin >> T;
for(i=0;i<T;i++)
{
cin >> n >> m;
while (n--)
{
cin >> a;
if (a < s)
{
s = a;
}
}
if (m)
{
while (m--)
{
cin >> b;
if (b < t)
{
t = b;
}
}
}
cout << "Problem " << i + 1001 << ":" << endl;
cout << "Shortest judge solution: " << s <<" bytes."<<endl;
s = 65536;
if (m)
{
cout << "Shortest team solution: " << t<<" bytes."<<endl;
}
else
{
cout << "Shortest team solution: N/A bytes."<<endl;
}
t = 65536;
}
}