7 条题解

  • 0
    @ 2022-11-5 11:19:14
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	cin>>n;
    	int a[n];
    	double tot=0;
    	for(int i=1;i<=n;i++){
    		cin>>a[i]; tot+=a[i];
    		} tot/=(float)n;
    		cout<<"AVE=";
    		printf("%.1f",tot);
    		cout<<endl;
    		for(int i=1;i<=n;i++){
    			if(a[i]>tot)
    				cout<<i<<":"<<a[i]<<" ";
    	}
    	return 0;
    }
    

    【入门】找找谁的身高超过全家的平均身高

    信息

    ID
    155
    时间
    1000ms
    内存
    16MiB
    难度
    3
    标签
    递交数
    88
    已通过
    49
    上传者