"카타 8급 Expressions Matter"의 두 판 사이의 차이

9번째 줄: 9번째 줄:
   return res;
   return res;
}
}
</source>
==C++==
{{카타|8급|C++|8}}
<source lang='cpp'>
</source>
</source>

2019년 3월 17일 (일) 16:43 판

1 C

int expression_matter(int a, int b, int c) {
  int res = a + b + c;
  if ((a + b) * c > res) res = (a + b) * c;
  if (a * (b + c) > res) res = a * (b + c);
  if (a * b * c > res) res = a * b * c;
  return res;
}

2 C++

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}