社区讨论
求指教哪里有问题?
P1085[NOIP 2004 普及组] 不高兴的津津参与者 1已保存回复 3
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 3 条
- 当前快照
- 1 份
- 快照标识符
- @mi4f2cdu
- 此快照首次捕获于
- 2025/11/18 18:14 4 个月前
- 此快照最后确认于
- 2025/11/18 18:14 4 个月前
代码如下,不知为何错了,求支援。
[codec ]
CPP#include<iostream>
using namespace std;
int max(int a,int b)
{
if(a>=b)
return a;
else
return b;
}
int main()
{
int tot[8]={0};
int school,after,tmax,rem=0;
for(int i=1;i<=7;i++)
{
cin>>school>>after;
tot[i]=school+after;
if(tot[i]<=8)
tot[i]=0;
}
for(int i=1;i<=7;i++)
{
if(tmax<tot[i])
{
tmax=tot[i];
rem=i;
}
}
cout<<rem;
}
[/codec ]
回复
共 3 条回复,欢迎继续交流。
正在加载回复...