DESCRIPTION(x1, y1)과 (x2, y2)을 지나는 직선 1과 (x3, y3)과 (x4, y4)를 지나는 직선 2가 있을때, 서로 다른 두 직선의 교점은 다음 선형 방정식을 통해서 계산 할 수 있다. Two points on line 1 are given as (x1, y1) and (x2, y2) and on line 2 as (x3, y3) and (x4, y4), as shown in Figure 3.8a–b. The intersecting point of the two lines can be found by solving the following linear equation: 위 선형 방정식의 해는 "4326 - 대수: 2 * 2 선형 방정식 풀이" 문제에서 사용한 Cramer's ru..
DESCRIPTION중심이 (0, 0)이고 너비가 10, 높이가 5인 사각형이 주어져 있을때 입력받은 점 (x, y)가 해당 사각형 안에 포함되는지 안되는지 체크하는 프로그램을 작성하려고 합니다. 예를 들어, (2, 2)는 사각형 안에 포함되어 있으므로 in을 출력하고 (6, 4)는 사각형 밖에 있으므로 out을 출력하면 됩니다. 점이 사각형의 선분에 있을 경우에는 on을 출력합니다. Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (0, 0) with width 10 and height 5. For example, (2, 2)..
DESCRIPTIONZeller’s congruence는 날짜의 요일을 계산하기 위해서 Christian Zeller에 의해서 고안된 알고리즘이며 그 식은 다음과 같습니다. 식에서 모든 분수 계산은 버림으로 수행 되어야 하므로 주의해야 합니다. Zeller’s congruence is an algorithm developed by Christian Zeller to calculate the day of the week. The formula is 사용자로부터 년도, 월, 일로 구성된 날짜을 입력받아 해당 날짜는 무슨 요일인이 출력하는 프로그램을 작성하세요. Note that the division in the formula performs an integer division. Write a program..
DESCRIPTIONISBN-10 (International Standard Book Number)은 10자리 숫자로 되어 있습니다. ISBN-10의 각 숫자를 차례대로 d1d2d3d4d5d6d7d8d9d10 라고 했을때, 마지막 숫자 d10 은 앞의 9개의 숫자를 다음 공식에 넣어서 구한 값입니다. An ISBN-10 (International Standard Book Number) consists of 10 digits: d1d2d3d4d5d6d7d8d9d10. The last digit, d10, is a checksum, which is calculated from the other nine digits using the following formula: 만약 위 식을 통해서 구한 값이 10이라면..
DESCRIPTION선형 방정식의 해는 다음 Cramer's rule를 이용해 구할 수 있습니다. A linear equation can be solved using Cramer's rule using the following formula: 사용자로부터 a, b, c, d, e, f를 입력받아 x, y를 구하는 프로그램을 작성하세요. 만약 해가 존재하지 않을 경우 "no solution"이라고 출력하세요. Write a program that prompts the user to enter a, b, c, d, e, and f and displays the result. If ad - bc is 0, report that "no solution"INPUT* Line 1 : 6개의 실수 a, b, c, d..
DESCRIPTION2차 방정식의 해는 다음 공식을 통해서 구할 수 있습니다. The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula: 위 식에서 b^2-4ac 는 2차방정식의 판별식이라고 합니다. 만약 2차 방정식의 판별식이 0보다 크다면 2개의 실수해를 가지고, 0이라면 1개의 실수해를 가지고, 0보다 작다면 0개의 실수해를 가집니다. a, b, c의 값을 입력으로 받아 해를 출력하는 프로그램을 작성하세요. b^2-4ac is called the discriminant of the quadratic equation. If it is positive, the equation has..
DESCRIPTION삼각형을 이루는 3개의 점 (x1, y1), (x2, y2), (x3, y3) 를 입력받아, 그 넓이를 계산하는 프로그램을 작성하세요. 삼각형의 넓이를 구하는 공식은 다음과 같습니다. Write a program that prompts the user to enter three points (x1, y1), (x2, y2), (x3, y3) of a triangle and displays its area. The formula for computing the area of a triangle is s = (side1 + side2 + side3)/2 area = sqrt(s(s - side1)(s - side2)(s - side3))INPUT* Line 1 : 첫번째 점의 좌표 x y..
DESCRIPTIONBody Mass Index (BMI)는 몸무게를 기반으로 하는 건강 측성 수치입니다. BMI를 측정하는 방법은 당신의 몸무게(kg)을 키(m)의 제곱으로 나누면 됩니다. 몸무게 W(pounds)와 키 H(inches)를 입력으로 받아 BMI를 구하는 프로그램을 작성하세요. 1 pound는 0.45359237 kg이고 1 inch는 0.0254 meters 입니다. Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program ..