1 solutions

  • 0
    @ 2023-1-29 15:23:36
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int x;
        double sum=0,num=0;
        for(int i=1;i<=9999999;i++)
        {
            cin >> x;
            if(x==0)
            {
                break;
            }
            sum+=x;
            num++;
        }
        cout << fixed << setprecision(1);
        cout << sum/num << " ";
        sum=0;
        num=0;
        for(int i=1;i<=9999999;i++)
        {
            cin >> x;
            if(x==0)
            {
                break;
            }
            sum+=x;
            num++;
        }
        cout << fixed << setprecision(1);
        cout << sum/num;
    }
    
    

    Information

    ID
    656
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    10
    Tags
    # Submissions
    4
    Accepted
    3
    Uploaded By