7 条题解

  • 1
    @ 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;
    }
    
    • 0
      @ 2023-3-18 22:24:46

      #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; }

      • 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;
        }
        
        • 0
          @ 2022-10-29 16:05:56

          #include<bits/stdc++.h> using namespace std; int a[114514];//数组元素 int main() { float sum=0,m,n,b; cin>>m; for(int i=0;i<m;i++){ cin>>a[i]; sum+=a[i]; }

          b=float(sum)/m;
          cout<<"AVE=";
          printf("%.1f",b);
          cout<<endl;
          
          for(int k=0;k<m;k++){
          	if(a[k]>b){
          		cout<<k+1<<":"<<a[k]<<endl;
          	}
          	
          }
          return 0;
          

          }

          • 0
            @ 2022-10-29 15:42:06

            #include<bits/stdc++.h> using namespace std; int a[16]; int main(){ int n,sum=0; float p; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; sum+=a[i]; } p = float(sum)/n; cout<<"AVE="; printf("%.1f",p); cout<<endl; for(int i=1;i<=n;i++){ if(a[i]>p){ cout<<i<<":"<<a[i]<<" "; } } return 0; }

            • 0
              @ 2022-10-29 15:36:29
              #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;
              }
              
              • 0
                @ 2022-10-29 15:32:55

                #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; }

                • 1

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

                信息

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