DESCRIPTION전공과 학년을 의미하는 두개의 문자를 입력으로 받아 전공과 학년의 완벽한 이름을 출력하는 프로그램을 작성하세요. 첫번째 문자는 전공을 나타내며 아래 보이는 목록중 하나입니다. 두번째 문자는 학년을 나타내며 1부터 차례대로 Freshman, Sophomore, Junior, Senior로 표현하면 됩니다. Write a program that prompts the user to enter two characters and displays the major and status represented in the characters. The first character indicates the major and the second is number character 1, 2, 3, 4, wh..
DESCRIPTION0부터 100사이의 정수를 입력받아 16진수로 출력하는 프로그램을 작성하세요. Write a program that prompts the user to enter an integer between 0 and 100 and displays its corresponding hex number. INPUT* Line 1 : 정수 (0~100) OUTPUT* Line 1 : HEX값 (0~64범위의 hex값; a-f는 소문자로 표시) SAMPLE INPUT100SAMPLE OUTPUT64
DESCRIPTION정다각형은 변의 길이가 모두 동일한 다각형입니다. 변의 개수 n과 변의 길이 s가 주어졌을때 정다각형의 넓이를 계산하는 프로그램을 작성하세요. 정다각형의 넓이를 계산하는 공식은 다음과 같습니다. A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular). The formula for computing the area of a regular polygon is Here, s is the length of a side. Write a pro..
DESCRIPTION대권거리(great circle distance)는 지구표면에서 두 점 사이의 거리를 의미합니다. (x1, y1)과 (x2, y2)를 위도(latitude)와 경도(longitude)로 구성된 두 지점이라고 할때, 두 지점 사이의 대권거리는 다음 공식을 통해서 계산할 수 있습니다. The great circle distance is the distance between two points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographical latitude and longitude of two points. The great circle distance between the two points can be ..
DESCRIPTION오각형의 중심으로부터 정점까지의 거리 r을 입력받아 오각형의 넓이를 계산하는 프로그램을 작성하세요. Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. where r is the length from the center of a pentagon to a vertex. Round up two digits after the decimal point. INPUT* Line 1 : 실수 r (0~100)OUTPUT* Line 1 : pen..
DESCRIPTION정점 p0(x0, y0)에서 정점 p1(x1, y1)로의 직선이 있을 때, 정점 p2(x2, y2)가 직선의 왼쪽 또는 오른쪽 또는 직선의 연장선(양방향) 위에 있는지 판단하는 프로그램을 작성하세요. Given a directed line from point p0(x0, y0) to p1(x1, y1), you can use the following condition to decide whether a point p2(x2, y2) is on the left of the line, on the right, or on the same line (see Figure 3.11): Write a program that prompts the user to enter the three point..
DESCRIPTION두개의 사각형의 중심좌표(x, y)와 길이 w와 높이 h를 입력받아, 두번째 사각형이 첫번째 사각형에 포함되는지 겹치는지 또는 아무 관계가 아닌지 판단하는 프로그램을 작성하세요. Write a program that prompts the user to enter the center x-, y-coordinates, width, and height of two rectangles and determines whether the second rectangle is inside the first or overlaps with the first, as shown in Figure 3.9. Test your program to cover all cases. INPUT* Line 1 : x1 y..
DESCRIPTION아래 그림처럼 삼각형이 평면위에 있다. 삼각형의 한 정점은 원점 (0, 0)에 위치하고 나머지 두 정점은 (200, 0)와 (0, 100)에 위치한다. 여러분은 x, y 좌표를 입력으로 받아 해당 좌표가 삼각형 내부에 있는지 외부에 있는지 판단하는 프로그램을 작성해야 한다. (기존 문제는 이렇지만 쫌더 어렵게 하기 위해) 단, 입력받은 좌표는 삼각형의 왼쪽 또는 아래에 있을 수 도 있기 때문에 주의 해야 한다. 또한 삼각형의 변에 좌표가 위치할 수 도 있다. Suppose a right triangle is placed in a plane as shown below. The right-angle point is placed at (0, 0), and the other two point..