标签:
water~
#include<cstdio>
int main() {
int kase(0), n;
while (scanf("%d", &n) == 1) {
int s[20];
for (int i = 0; i != n; ++i)
scanf("%d", &s[i]);
long long ans(0);
for (int i = 0; i != n; ++i) {
long long ansT(1);
for (int j = i; j != n; ++j) {
ansT *= s[j];
if (ans < ansT) ans = ansT;
}
}
printf("Case #%d: The maximum product is %lld.\n\n", ++kase, ans);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/liangyongrui/p/4666977.html