2 solutions

  • 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;
    }
    
    • 0
      @ 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
      183
      Accepted
      69
      Uploaded By