3 条题解

  • 1
    @ 2024-2-23 9:36:07

    #include<bits/stdc++.h> using namespace std; int n,sum,x; int main(){ cin >> n; for(int i=1;i<=n;i++){ cin >> x; sum += x; } printf("%d %.5lf",sum,1.0*sum/n); return 0; }

    • 0
      @ 2024-3-19 22:17:38
      #include<iostream>
      #include<stdlib.h>
      #include<stdio.h>
      #include<math.h>
      using namespace std;
      int main()
      {
      	long long n,t,s=0;
      	cin>>n;
      	for (int i=0;i<n;i++)
      	{
      		cin>>t;
      		s+=t;
      	}
      	printf("%d %.5f",s,1.0*s/n);
      	system("pause");
      	return 0;
      }
      
      • 0
        @ 2024-2-19 16:47:44
        #include<iostream>
        #include<stdlib.h>
        #include<stdio.h>
        #include<math.h>
        using namespace std;
        int main()
        {
        	long long n,t,s=0;
        	cin>>n;
        	for (int i=0;i<n;i++)
        	{
        		cin>>t;
        		s+=t;
        	}
        	printf("%d %.5f",s,1.0*s/n);
        	system("pause");
        	return 0;
        }
        
        • 1

        信息

        ID
        667
        时间
        1000ms
        内存
        128MiB
        难度
        6
        标签
        递交数
        253
        已通过
        83
        上传者