3 条题解

  • 1
    @ 2022-4-30 16:57:52

    #include<iostream>

    #include<iomanip>

    using namespace std;

    int main (){

    double b,c,d;
    
    int a ,e = 1;
    
    cin >> a;
    
    while(e <= a){
    
    	cin >> b;
    
    	c = c + b;
    
    	e++;
    
    }
    
    d = c / a;
    
    cout << c << " " << fixed << setprecision(5) << 1.0 * d << endl;
    

    }

    • 0
      @ 2024-6-12 20:31:38
      col1 col2 col3
      #include
      using namespace std;
      int main(){
      int n,sum=0;
      cin>>n;
      for(int i=1;i<=n;i++){
      int a;
      cin>>a;
      sum+=a;
      }
      printf("%d %.5f",sum,sum*1.0/n);
      }
      //dongliyang6666666666666666666skhjkfgjgkjhfgjDV
      没有工具包
      • 0
        @ 2024-6-12 20:12:15
        #include<cstdio>
        #include<cstdlib>
        #include<cmath>
        #include<cctype>
        #include<cstring>
        #include<string>
        #include<vector>
        #include<set>
        #include<stack>
        #include<queue>
        #include<iostream>
        #include<iomanip>
        #include<ctime>
        #include<algorithm>
        #include<map>
        using namespace std;
        int main(){
            int n,sum=0;
            cin>>n;
            for(int i=1;i<=n;i++){
                int a;
                cin>>a;
                sum+=a;
            }
            printf("%d %.5f",sum,sum*1.0/n);
        }
        
        • 1

        信息

        ID
        936
        时间
        1000ms
        内存
        128MiB
        难度
        4
        标签
        递交数
        132
        已通过
        57
        上传者