7 solutions

  • 1
    @ 2025-8-22 16:24:21
    #include<bits/stdc++.h>
    using namespace std;
    int n;
    int main(){
    	cin>>n;
    	double cnt=0;
    	double t;
    	for(int i=1;i<=n;i++){
    		cin>>t;
    		cnt+=t;
    	}
    	cout<<cnt<<' '<<fixed<<setprecision(5)<<cnt/n;
    	return 0;
    }
    
    • -1
      @ 2024-11-11 19:05:26
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n;
          double j = 0;
          cin>>n;
          for(int i = 1;i <= n;i++)
          {
              int x;
              cin>>x;
              j += x;
          }
          cout<<j<<" ";
          cout<<fixed<<setprecision(5)<<j / n;
          return 0;
      }
      
      
      • -1
        @ 2024-9-22 10:13:19
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	double a=0,b=0,c=0,n=0,x=0;
        	int m=0;
        	cin>>n;
        	for(int i=1;i<=n;i++)
        	{
        		cin>>x;
        		m=m+x;
        	}
        	b=m/n;
        	cout<<m<<" ";
        	cout<<fixed<<setprecision(5)<<b;
        	
        	
        	return 0;
        }
        
        • -2
          @ 2025-8-5 14:10:48

          #include<bits/stdc++.h> using namespace std; int n; int main(){ cin>>n; double cnt=0; double t; for(int i=1;i<=n;i++){ cin>>t; cnt+=t; } cout<<cnt<<' '<<fixed<<setprecision(5)<<cnt/n; return 0; }

          • -2
            @ 2024-9-22 10:12:54
            #include<bits/stdc++.h>
            using namespace std;
            int main()
            {
            	int n;
            	cin>>n;
            	double cut;
            	for(int i=1;i<=n;i++)
            	{
            		int x;
            		cin>>x;
            		cut+=x;
            	}
            	cout<<cut<<" "<<fixed<<setprecision(5)<<cut/n;
                return 0;
            }
            • -2
              @ 2024-9-8 15:05:40

              这题太难看

              • -6
                @ 2024-9-22 10:13:17

                #include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; int s; double d=0; for (int i=1;i<=a;i++) { cin>>s; d+=s; } cout<<d<<" "; cout<<fixed<<setprecision(5)<<d/a; return 0; }

                • 1

                Information

                ID
                872
                Time
                1000ms
                Memory
                256MiB
                Difficulty
                1
                Tags
                (None)
                # Submissions
                224
                Accepted
                81
                Uploaded By