3 条题解

  • 5
    @ 2022-12-17 14:16:56
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        double n, m;
        double sum1 = 0, sum2 = 0;
        cin >> n >> m;
        for (int i = 1; i <= n; i++)
        {
            int x;
            cin >> x;
            sum1 += x;
        }
        for (int i = 1; i <= m; i++)
        {
            int v;
            cin >> v;
            sum2 += v;
        }
        sum1 /= n;
        sum2 /= m;
        if (sum1 > sum2)
        {
            cout << "A";
        }
        else if (sum2 > sum1)
        {
            cout << "B";
        }
        return 0;
    }
    
    • 1
      @ 2022-7-3 15:48:26

      #include <bits/stdc++.h> using namespace std; int main() { int n,m,a[100],b[100],k=0,l=0; cin>>n>>m; for(int i=1;i<=n;i++) { cin>>a[i]; k+=a[i]; } for(int d=1;d<=m;d++) { cin>>b[d]; l+=b[d]; } k/=n; l/=m; if(l>k) { cout<<"B"; } else if(l<k) { cout<<"A"; }

      }

      • 1
        @ 2022-3-6 17:06:00

        #include<bits/stdc++.h> using namespace std; int main() { double n,m,x,sum1=0,sum2=0; cin>>n>>m; for (int i=1;i<=n;i++) { cin>>x; sum1+=x; } sum1/=n; for (int i=1;i<=m;i++) { cin>>x; sum2+=x; } sum2/=m; if (sum1>sum2) { cout<<"A"; } else { cout<<"B"; } return 0; }

        • 1

        信息

        ID
        1233
        时间
        1000ms
        内存
        256MiB
        难度
        8
        标签
        递交数
        923
        已通过
        157
        上传者