DESCRIPTIONShort 범위에 해당되는 값을 입력 받아, binary로 출력하는 프로그램을 작성하세요. A short value S is stored in 16 bits. Write a program that prompts the user to enter a short integer and displays the 16 bits for the integer.INPUT* Line 1 : 테스트케이스 T (1~1,000) * Line 2 ~ T+1 : S (-32,768~32,767) OUTPUT* Line 1 ~ T : S에 대한 bit 표현 SAMPLE INPUT2 5 -5 SAMPLE OUTPUT0000000000000101 1111111111111011HINTYou need to use the ..
DESCRIPTIONN개의 정수를 입력으로 받아, 가장 많이 나타난 정수와 그 개수를 출력하는 프로그램을 작성하세요. 만약 3 5 2 5 5 5을 입력으로 받는다면 가장 많이 나타난 정수는 5이고 그 개수는 4입니다. Write a program that reads integers, finds the most frequent number of them, and counts its occurrences. Suppose that you entered 3 5 2 5 5 5; the program finds that the most frequent number is 5 and the occurrence count for 5 is 4. INPUT* Line 1 : 정수의 개수 N (1~1,000) * Line 2..
DESCRIPTION년과 월을 입력으로 받아 해당 월의 달력을 출력하는 프로그램을 작성하세요. Write a program that prompts the user to enter the year and the month and displays the calendar table for the year on the console. INPUT* Line 1 : year (1,500~3,000) * Line 2 : month (1~12)OUTPUTSample Output 참조SAMPLE INPUT2013 1SAMPLE OUTPUTSun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ..
DESCRIPTION당신은 다음 계산식을 통해서 e를 계산할 수 있습니다. i를 입력으로 받아 e를 계산하는 프로그램을 작성하세요. You can approximate e using the following series: Write a program that displays the e value for i INPUT* Line 1 : 테스트케이스 T (1~100) * Line 2 ~ T+1 : 정수 i (1~100) OUTPUT* Line 1 ~ T : e(소수점 여섯째자리까지만 출력. sample 참고) SAMPLE INPUT3 2 8 20SAMPLE OUTPUT2.500000 2.718278 2.718281 SOURCEJAVA2015 PE5.26
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로 출력) SAMPLE INPUT3 9 999 99999SAMPLE OUTPUT3.2523 3.1425 3..
DESCRIPTION피라미드의 크기 N을 입력받아, 숫자로된 피라미드를 출력하는 프로그램을 작성하세요. 만약 N=8일 경우 다음과 같이 출력되어야 합니다. Write a program that prompts the user to enter an integer N from 1 to 10 and displays a pyramid. If N=8, pyramid is displayed as shown in following: INPUT* Line 1 : 피라미드의 크기 N (1~10) OUTPUTN크기의 피라미드(각 숫자는 4칸의 공간을 할당 받습니다. 한자리 수일 경우 공백*3숫자(' 2') 이고 세자리 수일 경우 공백숫자(' 128') 입니다. 아무 숫자도 들어가지 않을 떄는 공백 4칸입니다.(' '))SA..
DESCRIPTION다이아몬드의 크기 N을 입력으로 받아 출력하는 프로그램을 작성하세요. Write a program that prompts the user to enter an integer N from 1 to 15 and displays a diamond. INPUT* Line 1 : 다이아몬드의 크기 N (1~15OUTPUTN크기의 다이아몬드SAMPLE INPUT5SAMPLE OUTPUT * *** ***** ******* ********* ******* ***** *** * COMment 와, 이건 왜 DataInputStream을 사용했을까요? java.io 라이브러리의 첫 등장입니다. 굳이 왜 사용했는지는 잘 모르겠고, java.util.Scanner를 그대로 사용하여도 아무 문제 없습니다.
DESCRIPTION피라미드의 크기 N을 입력으로 받아 출력하는 프로그램을 작성하세요. Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid. INPUT* Line 1 : 피라미드의 크기 N (1~15) OUTPUTN크기의 피라미드 SAMPLE INPUT5SAMPLE OUTPUT * ** *** **** ***** **** *** ** *SOURCEJAVA2015 PE5.17