-
HackerRank.com Practice > C++ > Introduction > Functionshackerrank.com 2020. 4. 17. 07:17728x90
#include <iostream> #include <cstdio> using namespace std; /* Add `int max_of_four(int a, int b, int c, int d)` here. */ int max_of_four(int a, int b, int c, int d) { return max(max(a, b), max(c, d)); } int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); int ans = max_of_four(a, b, c, d); printf("%d", ans); return 0; }
728x90'hackerrank.com' 카테고리의 다른 글
HackerRank.com Practice > C++ > Introduction > Arrays Introduction (0) 2020.04.17 HackerRank.com Practice > C++ > Introduction > Pointer (0) 2020.04.17 HackerRank.com Practice > C++ > Introduction > For Loop (0) 2020.04.17 HackerRank.com Practice > C++ > Introduction > Conditional Statements (0) 2020.04.16 HackerRank.com Practice > C++ > Introduction > Basic Data Types (0) 2020.04.16