3 solutions

  • 0
    @ 2026-3-22 13:59:40
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        double n,e,cnt;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
        	cin>>e;
        	cnt+=e;
    	}
    	cout<<fixed<<setprecision(2)<<cnt/n; 
        return 0;
    }
    复制的是gay
    
    • -1
      @ 2025-7-4 9:15:37
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          double n,e,cnt;
          cin>>n;
          for(int i=1;i<=n;i++)
          {
              cin>>e;
              cnt+=e;
          }
          cout<<fixed<<setprecision(2)<<cnt/n;
          return 0;
      }
      
      • -2
        @ 2025-1-17 21:28:42
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        int n;
        cin>>n;
        double s=0;
        for(int i=1;i<=n;i++)
        {
        	int x;
        	cin>>x;
        	s=s+x;
        }
        double a=s*1.0/n;
        cout<<fixed<<setprecision(2)<<a;
        return 0;
        }
        
        
        • 1

        Information

        ID
        871
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        1
        Tags
        (None)
        # Submissions
        296
        Accepted
        107
        Uploaded By