社区讨论

编译都过不去,QAQ

P5741【深基7.例10】旗鼓相当的对手 - 加强版参与者 3已保存回复 8

讨论操作

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

当前回复
8 条
当前快照
1 份
快照标识符
@ltuzxgnk
此快照首次捕获于
2024/03/17 12:07
2 年前
此快照最后确认于
2024/03/17 14:10
2 年前
查看原帖
CPP
#include <bits/stdc++.h>
using namespace std;
string name[1001];
int score[1000][3],n,h[1000];
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%s",&name[i]);
		for(int j=0;j<3;j++){
			scanf("%d",&score[i][j]);
			h[i]+=score[i][j];
		}
	}
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			if(h[i]-h[j]>-10&&h[i]-h[j]<-10){
				if(score[i][0]-score[j][0]>-5&&score[i][0]-score[j][0]<5){
					if(score[i][1]-score[j][1]>-5&&score[i][1]-score[j][1]<5){
					     if(score[i][2]-score[j][2]>-5&&score[i][2]-score[j][2]<5) printf("%s %s\n",name[i],name[j]);
				    }  
				}
			}
		}
	}
	return 0;
} 

回复

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

正在加载回复...