题目链接:http://ac.jobdu.com/problem.php?pid=1046
题目分析:
不分析了,太简单了=。= 注意一下输入的时候是多组吧。
源代码:
#include <iostream>
using namespace std;
int main()
{
int a[10] = {0};
while (cin>>a[0])
{
for (int i = 1; i < 10; i++)
{
cin>>a[i];
}
int max = 0;
max = a[0];
for (int i = 1; i < 10; i++)
{
if (max < a[i])
{
max = a[i];
}
}
cout<<"max="<<max<<endl;
}
return 0;
}
本文详细介绍了如何解决ACM竞赛中的一个基础问题,即处理多组输入并找出每组的最大值。通过使用C++语言实现,文章提供了清晰的代码示例,帮助初学者理解输入处理和最大值查找的基本步骤。
1413

被折叠的 条评论
为什么被折叠?



