본문 바로가기
반응형

Java21

Chapter 8. Multidimensional Arrays(1)[Java Basic] 8.A - 한주에 얼마나 일하나? Time Limit: 1s Memory Limit: 128MB DESCRIPTION 요일별 직원들의 작업시간이 2차 배열에 들어 있다. 배열의 매 행에는 직원의 일주일 작업시간이 열로 구분되어 저장되어 있다. 예를 들어, 8명의 직원의 작업시간은 다음 그림처럼 저장된다. 여러분은 각 직원의 작업시간을 입력 받아서 한 주 동안 가장 많이 일한 직원부터 내림차순으로 출력하는 프로그램을 작성해야 한다. Suppose the weekly hours for all employees are stored in a two-dimensional array. Each row records an employee's seven-day work hours with seven columns. F.. 2021. 11. 6.
Chapter 7. Single-Dimensional Arrays[Java Basic] 7.A - 성적 주기 Time Limit: 1s Memory Limit: 128MB DESCRIPTION 학생들의 점수를 입력받아서 최고점을 찾아내고, 이를 토대로 학생들의 성적을 결정해주는 프로그램을 작성하세요. 규칙은 다음과 같습니다. 성적이 최고점-10 이상이면 A 성적이 최고점-20 이상이면 B 성적이 최고점-30 이상이면 C 성적이 최고점-40 이상이면 D 그외는 F Write a program that reads student scores, gets the best score, and then assigns grades based on the following scheme: Grade is A if score is ≥ best - 10 Grade is B if score is ≥ best - .. 2021. 11. 5.
Chapter 6. Methods[Java Basic] 6.A - Palindrome 수 Time Limit: 1s Memory Limit: 128MB DESCRIPTION 정수를 입력으로 받아 palindrome 숫자인지 체크하는 프로그램을 작성하세요. 왼쪽에서 오른쪽으로 읽는 것과 오른쪽에서 왼쪽으로 읽는 것이 동일할 경우 palindrome 숫자라고 합니다. Write a test program that prompts the user to enter an integer and reports whether the integer is a palindrome. A number is palindrome if it reads the same from right to left and from left to right. INPUT * Line 1 : 테스트케이스 T.. 2021. 11. 5.
Chapter 5. Loops(2)[Java Basic] 5.H - π 계산 Time Limit: 1s Memory Limit: 128MB DESCRIPTION 당신은 다음 계산식을 통해서 pi를 계산할 수 있습니다. i를 입력으로 받아 pi를 계산하는 프로그램을 작성하세요. You can approximate pi by using the following series: Write a program that displays the pi value for i. INPUT * Line 1 : 테스트케이스 T (1~1,000) * Line 2 ~ T+1 : 정수 i (1~1,00000) OUTPUT * Line 1 ~ T : pi(소수점 네번째 자리까지 출력, 예: 11.713243의 경우 11.7132로 출력하고 11.0000의 경우 11.0000로 출력) SAM.. 2021. 11. 5.
Chapter 5. Loops(1)[Java Basic] 5.A - 두명의 하이스코어 Time Limit: 1s Memory Limit: 128MB DESCRIPTION N명의 학생의 이름과 성적을 입력으로 받아, 1등과 2등을 한 학생의 이름과 성적을 출력하는 프로그램을 작성하세요. Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score and the student with the second-highest score. INPUT * Line 1 : 학생수 N (2~10) * Line 2 ~ N+1 : 이름 점수 - 이름은 길이가.. 2021. 11. 5.
Chapter 4. Mathematical Functions, Characters, and Strings[Java Basic] 4.A - 기하: 5각형의 넓이 Time Limit: 1s Memory Limit: 128MB 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 p.. 2021. 11. 5.
반응형