洛谷P2911 [USACO08OCT]Bovine Bones G

P2911 [USACO08OCT]Bovine Bones G

题目链接

#include<iostream>
using namespace std;
int main()
{
	int s1, s2, s3, num[100] = {0}, maxn = 0, ans;
	cin >> s1 >> s2 >> s3;
	for(int i = 1; i <= s1; i++)
		for(int j = 1; j <= s2; j++)
			for(int k = 1; k <= s3; k++)
				num[i + j + k]++;
	for(int i = 0; i <= s1 + s2 + s3; i++)
		if(num[i] > maxn)
		{
			maxn = num[i];
			ans = i;
		}
	cout << ans << endl;
	return 0;
}
上一篇:202006-1线性分类器


下一篇:全国职业院校《计算机网络应用》赛项 2019 年广西高职组------样题分析