40分,求助
查看原帖
40分,求助
1444398
cathyxu2013楼主2024/12/9 16:44
#include <iostream>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <numeric>
 
using namespace std;

int a[16001];

int main() {
    int as,bs,cs;
    cin >> as >> bs >> cs;
    for (int i=1; i<as; i++) {
        for (int j=1; j<=bs; j++) {
            for (int k=1; k<=cs; k++) {
                a[i+j+k]++;
            }
        }
    }
    int max=0,n=0;
    for (int i=1; i<as*bs*cs; i++) {
        if (a[i]>max){
            max=a[i];
            n=i;
        }
    }
    cout << n << endl;
    return 0;
}

2024/12/9 16:44
加载中...