CodeforcesRound#274(Div.2)AExpression_html/css_WEB-ITnose
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CodeforcesRound#274(Div.2)AExpression_html/css_WEB-ITnose,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2219字,纯文字阅读大概需要4分钟。
内容图文
![CodeforcesRound#274(Div.2)AExpression_html/css_WEB-ITnose](/upload/InfoBanner/zyjiaocheng/399/82e8637a481f4e0b9581e2377ba8224b.jpg)
Expression
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Petya studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers a, b, c on the blackboard. The task was to insert signs of operations '+' and '*', and probably brackets between the numbers so that the value of the resulting expression is as large as possible. Let's consider an example: assume that the teacher wrote numbers 1, 2 and 3 on the blackboard. Here are some ways of placing signs and brackets:
Note that you can insert operation signs only between a and b, and between b and c, that is, you cannot swap integers. For instance, in the given sample you cannot get expression (1+3)*2.
It's easy to see that the maximum value that you can obtain is 9.
Your task is: given a, b and c print the maximum value that you can get.
Input
The input contains three integers a, b and c, each on a single line (1?≤?a,?b,?c?≤?10).
Output
Print the maximum value of the expression that you can obtain.
Sample test(s)
input
123
output
input
2103
output
60
大致题意:a, b, c三个数,在三个数中,插入“+” 和“*”运算符的任意两个组合,求能组成的表达式的值得最大值。(可以用括号)
解题思路:没啥说的,直接暴力,总共就6种组合。
AC代码:
#include#include #include #include #include #include #include #include
内容总结
以上是互联网集市为您收集整理的CodeforcesRound#274(Div.2)AExpression_html/css_WEB-ITnose全部内容,希望文章能够帮你解决CodeforcesRound#274(Div.2)AExpression_html/css_WEB-ITnose所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。