zhangshengzhi @ 2024-12-21 10:00:47
#include<bits/stdc++.h>
using namespace std;
struct student
{
int fs[22],maxx=INT_MIN,minn=INT_MAX;
double pin=0;
}a[111];
int main()
{
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
cin>>a[i].fs[j];
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
a[i].pin=a[i].pin+a[i].fs[j];
if(a[i].fs[j]>a[i].maxx)
a[i].maxx=a[i].fs[j];
else if(a[i].fs[j]<a[i].minn)
a[i].minn=a[i].fs[j];
}
a[i].pin=1.0*(a[i].pin-a[i].maxx-a[i].minn)/(m*1.0-2.0)*1.0;
}
for(int i=2;i<=n;i++)
if(a[i].pin>a[1].pin)
a[1].pin=a[i].pin;
printf("%.2f",a[1].pin);
return 0;
}
by wenxiaoyang @ 2024-12-21 10:08:34
不是哪来的m啊?
by Short_person @ 2024-12-21 10:08:51
#include<bits/stdc++.h>
using namespace std;
struct stu{
string name;
long long cg;
long long mg;
long long yg;
};
stu a[2000];
int main(){
long long b,s,bian;
cin>>b;
for(long long i=1;i<=b;i++){
cin>>a[i].name>>a[i].cg>>a[i].mg>>a[i].yg;
if(i==1||a[i].cg+a[i].mg+a[i].yg>s){
s=a[i].cg+a[i].mg+a[i].yg;
bian=i;
}
}
cout<<a[bian].name<<" "<<a[bian].cg<<" "<<a[bian].mg<<" "<<a[bian].yg;
return 0;
}
被puck看到你就完了。
by wenxiaoyang @ 2024-12-21 10:10:55
@zhangshengzhi 是不是发错题了
by zhangshengzhi @ 2024-12-21 10:14:01
@wenxiaoyang发错了 : (
by linzishuai_YZSY @ 2024-12-21 10:49:53
哈哈,老同桌@zhangshengzhi,下次仔细点