규도자 개발 블로그

[해커랭크(Hackerrank)/Problem Solving/파이썬3(python3)] Solve Me First 본문

알고리즘/풀이

[해커랭크(Hackerrank)/Problem Solving/파이썬3(python3)] Solve Me First

규도자 (gyudoza) 2019. 3. 9. 15:01

Complete the function solveMeFirst to compute the sum of two integers.

Function prototype:

int solveMeFirst(int a, int b);

where,

  • a is the first integer input.
  • b is the second integer input

Return values

  • sum of the above two integers

Sample Input

a = 2
b = 3

Sample Output

5

Explanation

The sum of the two integers  and  is computed as: .

풀이

def solveMeFirst(a,b):
	return a + b


num1 = int(input())
num2 = int(input())
res = solveMeFirst(num1,num2)
print(res)

설명

단순하게 입력받은 num1과 num2를 더해 반환해주는 함수이다. 사실 뭔가 푼다기보다는 어떤식으로 해커랭크를 이용하는지 배울 수 있는 단계라고 보면 된다.

Comments