목록분류 전체보기 (496)
규도자 개발 블로그
"객체지향은 현실세계의 모방, 추상화하는 것은 아니다. 소프트웨어 안에 구현된 상품 객체는 실제 세계의 상품과는 전혀 다른 양상을 띤다. 오히려 현실세계를 기반으로 새로운 세계를 창조하는 것과 같다." 이 말이 이 책의 모든 내용을 함축하고 있다. 현실세계의 객체들은 수동적인 자세를 취하고 "인간"이라는 능동적인 객체가 직접적인 영향을 미치지만 소프트웨어세계에는 인간이 없다. 그래서 객체는 스스로 움직여야 한다. 현실세계에서는 사람이 음료수를 마시지만 소프트웨어세계에서는 사람이 음료수를 직접 마실 수 없다. 사람은 음료수에게 음료수를 이만큼 먹겠다는 메시지를 보내고 음료수는 그 메세지를 수신해서 스스로 그만큼의 양을 줄인다. 이것이 소프트웨어세계에서 객체들이 동작하는 방식이다. 소프트웨어세계에서는 모든 ..
Objective In this challenge, we review some basic concepts that will get you started with this series. You will need to use the same (or similar) syntax to read input and write output in challenges throughout HackerRank. Check out the Tutorial tab for learning materials and an instructional video! Task To complete this challenge, you must save a line of input from stdin to a variable, print Hell..
HackerLand University has the following grading policy:Every student receives a in the inclusive range from to .Any less than is a failing grade.Sam is a professor at the university and likes to round each student's according to these rules:If the difference between the and the next multiple of is less than , round up to the next multiple of .If the value of is less than , no rounding occurs as ..
Sam's house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where is the start point, and is the endpoint. The apple tree is to the left of his house, and the orange tree is to its right. You can assume the trees are located on a single point, where the apple tree is at point , and the orange tree is at point .When a ..
[백준/10950/파이썬] A+B - 3 문제 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 테스트 케이스의 개수 T가 주어진다.각 테스트 케이스는 한 줄로 이루어져 있으며, 각 줄에 A와 B가 주어진다. (0 < A, B < 10) 출력 각 테스트 케이스마다 A+B를 출력한다. 입출력 예 입력출력 5 1 1 2 3 3 4 9 8 5 22 5 7 17 7 풀이 count = int(input()) result_list = [] for i in range(count): number_input = input().split() number_input = map(int, number_input) result_list.append(sum(number_input)) f..
WHERE 1 = 1 TRICK 세상에 절대적인 것은 없다. 데이터베이스에서 특정 데이터를 불러와야 할 때 전용으로 만들어져있는 객체나 라이브러리를 이용하면 좋지만 불가피하게 다이나믹쿼리를 통해 구현해야 할 때가 있기 마련이다. 다이나믹쿼리로 구성돼있는 어플리케이션을 유지보수하거나, 혹은 특수한 쿼리를 이용해야할 때 등 말이다. 그럴 때 유용하게 쓸 수 있는 게 바로 WHERE 1 = 1 트릭이다. 간단한 sql은 이곳(sqltest.net)에서 실험할 수 있다. sqltest에 들어가서 오른쪽에 Select Database를 눌러 MYSQL로 설정한 뒤에 SQL Script란에 아래 sql을 입력하자. CREATE TABLE mysql_test ( id INT(6) UNSIGNED AUTO_INCREM..
[JavaScript/자바스크립트] 숫자 천 단위마다 콤마 찍는 내장 함수(toLocaleString) 나는 예전에 이런 글을 쓴 적이 있다. [JavaScript/자바스크립트] 숫자 천 단위마다 콤마 찍는 함수 정규식을 통해서 3자리마다 콤마를 찍고 반환하는 아주 간단한 함수인데 얼마 전에 다른 입출력값이 필요했다. 그러니까 위 게시물에 있는 함수인 function numberFormat(inputNumber) { return inputNumber.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } 은 소수자리까지도 콤마처리해버려서 쓰기 곤란했다. 그래서 더 찾아보니 자바스크립트 안에는 위 함수를 대체할만 한 아주 훌륭한 함수가 있었다. 바로 제목에도 써있는 t..
You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out.For example, if your niece is turning years old, and the cake will have candles of height , , , , she will be..
Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.For example, . Our minimum sum is and our maximum sum is . We would print16 24 Function DescriptionComplete the miniMaxSum function in the editor below. It ..
Consider a staircase of size : # ## ### #### Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.Write a program that prints a staircase of size .Function DescriptionComplete the staircase function in the editor below. It should print a staircase as described above.staircase has the following paramete..