社区讨论

球球大佬解答,谢谢!!!

P1085[NOIP 2004 普及组] 不高兴的津津参与者 1已保存回复 0

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
0 条
当前快照
1 份
快照标识符
@ltmuhbro
此快照首次捕获于
2024/03/11 19:13
2 年前
此快照最后确认于
2024/03/11 20:58
2 年前
查看原帖

这个程序哪里错啦??求求大佬解答!!!100分但没有通过

CPP
#include<iostream>
#include<fstream>
#include <iomanip>
#include <bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
	int i,j;
	int max=0;
	int d=0;
	for(int a=1;a<=7;a++)
	{
		cin>>i>>j;
		if((i+j)>max&&(i+j)>=8)
		{
			max=i+j;
			d=a;
		}
	}
	cout<<d;


	return 0;
}

回复

0 条回复,欢迎继续交流。

正在加载回复...