전체 글136 입력의 끝을 확인하는 문제_계산기 만들기 입력의 끝을 확인하는 문제_계산기 만들기 1. 프로그램 숫자와 연산자를 연속적으로 입력받아 계산하고 계산 결과를 출력하는 프로그램 2. 문제 상황 연속적으로 입력되는 입력값의 끝을 판단하려고 하였다. 예를들어 1 + 3+ 5 + 2 라는 값이 입력됐을 경우 while문을 통해 반복해서 값을 입력 받게하고 마지막 "2"가 들어오면 입력의 끝을 판단하고자 Scanner의 hasNext() 메서드를 사용했다. [hasNext 사용 예] Scanner input = new Scanner(System.in); . . . while (input.hasNext()) { String operator = input.next(); double num2 = input.nextDouble(); . . . } 그러나 while.. 2022. 7. 10. 3Sum Closest 3Sum Closest LeetCode 16번 문제 https://leetcode.com/problems/3sum-closest/ 3Sum Closest - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 문제 Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. Return th.. 2022. 7. 10. 미세먼지 안-녕! 미세먼지 안-녕! 백준 17144번 문제. https://www.acmicpc.net/problem/17144 17144번: 미세먼지 안녕! 미세먼지를 제거하기 위해 구사과는 공기청정기를 설치하려고 한다. 공기청정기의 성능을 테스트하기 위해 구사과는 집을 크기가 R×C인 격자판으로 나타냈고, 1×1 크기의 칸으로 나눴다. 구사 www.acmicpc.net 1. 문제 미세먼지를 제거하기 위해 구사과는 공기청정기를 설치하려고 한다. 공기청정기의 성능을 테스트하기 위해 구사과는 집을 크기가 R×C인 격자판으로 나타냈고, 1×1 크기의 칸으로 나눴다. 구사과는 뛰어난 코딩 실력을 이용해 각 칸 (r, c)에 있는 미세먼지의 양을 실시간으로 모니터링하는 시스템을 개발했다. (r, c)는 r행 c열을 의미한다. [.. 2022. 7. 8. Word Break Word Break leetcode 139번 문제. https://leetcode.com/problems/word-break/ Word Break - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 문제 Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictiona.. 2022. 6. 19. 이전 1 ··· 10 11 12 13 14 15 16 ··· 34 다음