30 条题解

  • -1
    @ 2023-3-13 16:56:17
    • #include<iostream>
      #include<stdio.h>
      using namespace std;
      int main()
      {
          int n;  
          cin >> n;
          double num,sum,avrage;
          for (int i = 1; i <= n; i++)
          {
              cin >> num;
              sum += num;
          }
          avrage = sum/n;
          printf("%.4lf",avrage );
      }
      

      Copy *

    • -1
      @ 2023-1-31 11:04:09
      #include<iostream>
      #include<iomanip>
      using namespace std;
      int main(){
      	double a,b,c;
      	cin>>a;
      	for(int i=1;i<=a;i++)
      	{
      		cin>>b;
      		c+=b;
      	}
      	cout<<fixed<<setprecision(4)<<c/a<<endl;
      }
      
      • -1
        @ 2022-10-19 21:42:29
        using namespace std;
        int main(){
        	double a,b,s=0;
        	cin>>b;
        	for(double i=1;i<=b;i++){
        		cin>>a;
        		s+=a;
        	}
        	cout<<fixed<<setprecision(4)<<s/b<<endl;
        }
        
        • -1
          @ 2022-2-5 11:59:28
          #include<iostream>
          #include<stdio.h>
          using namespace std;
          int main()
          {
              int n;  
              cin >> n;
              double num,sum,avrage;
              for (int i = 1; i <= n; i++)
              {
                  cin >> num;
                  sum += num;
              }
              avrage = sum/n;
              printf("%.4lf",avrage );
          }
          
          • -1
            @ 2022-1-9 20:12:45
            #include<iostream>
            #include<iomanip>
            using namespace std;
            int main()
            {
            	int n;  
                cin>>n;
                double num,sum,avrage;
                for (int i=1;i<=n;i++)
                {
                    cin>>num;
                    sum+=num;
                }
                avrage=sum/n;
                printf("%.4lf",avrage );
            }
            
            • -1
              @ 2022-1-8 16:47:54
              #include <iostream>
              #include <math.h>
              #include <iomanip>
              using namespace std;
              #define LL Long Long
              const int N=1e5+10;
              const int INF=0x3f3f3f3f;
              int main()
              {
              	int n;  
                  cin>>n;
                  double num,sum,avrage;
                  for (int i=1;i<=n;i++)
                  {
                      cin>>num;
                      sum+=num;
                  }
                  avrage=sum/n;
                  printf("%.4lf",avrage );
              }
              
              • -1
                @ 2022-1-8 15:38:15
                #include<iostream>
                #include<iomanip>
                using namespace std;
                int main()
                {
                    int n;  
                    cin >> n;
                    double num,sum,avrage;
                    for (int i = 1; i <= n; i++)
                    {
                        cin >> num;
                        sum += num;
                    }
                    avrage = sum/n;
                    printf("%.4lf",avrage );
                }
                
                • -2
                  @ 2023-3-22 20:21:55
                  #include<iostream>
                  #include<iomanip>
                  using namespace std;
                  int main(){
                  	double a,b,c;
                  	cin>>a;
                  	for(int i=1;i<=a;i++)
                  	{
                  		cin>>b;
                  		c+=b;
                  	}
                  	cout<<fixed<<setprecision(4)<<c/a<<endl;
                  }
                  
                  • -2
                    @ 2022-7-4 20:30:39

                    #include <stdio.h> #include <iostream> #include <math.h> using namespace std; int main() { double n ,sum = 0 , x; cin >> n; for(int i = 0 ; i < n ; i++) { cin >> x; sum += x; } printf("%.4lf",sum/n); }

                    • -2
                      @ 2022-1-19 16:15:22

                      #include <iostream> #include <stdio.h> using namespace std; int main() { int i,n; float s,x; cin>>n;

                      for(i=1; i<=n; i++)
                      {
                          cin>>x;
                          s=s+x;
                      }
                      s=s/n;
                      printf("%.4f",s);
                      return 0;
                      

                      }

                      信息

                      ID
                      921
                      时间
                      1000ms
                      内存
                      128MiB
                      难度
                      5
                      标签
                      递交数
                      1014
                      已通过
                      412
                      上传者