목록2019/03/14 (3)
규도자 블로그
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..