0
已解决
王祺册
资深守护
资深守护
题目链接: 酷町堂:7629
- #include<iostream>
- #include<iomanip>
- using namespace std;
- int n,m,c,a[15][15];
- long long sum,cnt; int maxn=-0x3f3f3f3f,minn=0x3f3f3f3f,posi,posj,si,sj;
- int main(){
- cin>>n>>m;
- for(int i=1;i<=n;i++){
- for(int j=1;j<=m;j++){
- cin>>a[i][j];
- cnt++;
- sum+=a[i][j];
- if(a[i][j]>=maxn){
- maxn=a[i][j];
- posi=i;
- posj=j; }
- if(a[i][j]<minn){
- minn=a[i][j];
- si=i;
- sj=j;
- }
- if(a[i][j]>=(double)sum/cnt){
- c++;
- }
- }
- }
- cout<<maxn<<" "<<posi<<" "<<posj<<endl<<minn<<" "<<si<<" "<<sj<<endl<<c<<" "<<setprecision(2)<<fixed<<(double)sum/cnt; return 0; }