这代码为什么70分啊!!!
查看原帖
这代码为什么70分啊!!!
1009083
dcx60楼主2025/6/30 16:08
#include<bits/stdc++.h>
using namespace std;

struct student{
	int sg;
	int tz;
}stu[3010];

int main(){
	int n,ans=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>stu[i].sg>>stu[i].tz;
	} 
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			if(stu[i].sg<stu[j].sg)
				ans++;
		}
	}
	cout<<ans;
	return 0;
}
2025/6/30 16:08
加载中...