분류 전체보기
-
level1 - 자릿수 더하기프로그래머스 2022. 9. 19. 11:28
문제 자연수 N이 주어지면, N의 각 자릿수의 합을 구해서 return 하는 solution 함수를 만들어 주세요. 예를들어 N = 123 이면 1 + 2 + 3 = 6을 return 하면 됩니다. 결과 N answer 123 6 987 24 방법 1.n을 string으로 변환한 다음 1자리씩 자르고 덧셈 연산을 수행 import java.util.*; public class Solution { public int solution(int n) { int answer = 0; String tmp = Integer.toString(n); for (int i = 0;i0){ answer = answer + n%10; n=n/10; } return answer; } }
-
level 1 - 짝수와 홀수프로그래머스 2022. 9. 19. 09:33
문제 정수 num이 짝수일 경우 Even 을 반환하고 홀수인 경우 Odd 를 반환하는 함수, solution을 완성해주세요. 결과 num return 3 "Odd" 4 "Even 방법 num값을 2로 나눈후 나머지가 0 이면 Even 나머지가 0이 아니면 Odd 출력 로직 class Solution { public String solution(int num) { String answer = ""; if(num%2==0){ answer = "Even"; }else{ answer = "Odd"; } return answer; } }
-
window.onload VS document.readyjavascript ES5 정리 2022. 6. 10. 15:10
//html페이지에 존재하는 모든 태그가 화면에 올라가는 순간이 로드가 완료되는 순간임. window.onload = function(){ console.log("win load.."); } //dom이 로그된 시점 //dom이란 //document object model 의 약자로써 와 같은 html 문서의 태그들을 js 가 이용할 수 있도록 객체로 만들어 놓은것이다. $(document).ready(function(){ console.log("docu load..") });
-
익명,선언적 함수javascript ES5 정리 2022. 6. 9. 12:01
//익명함수, 기명함수는 선언되는 시점이 완전히 다름 //익명함수 //브라우저가 런타임(RunTime)에 동적으로 선언되는 함수 var test = function(){ console.log("익명함수 테스트"); } //선언적함수 //브라우저가 런타임(RunTime) 이전에 선언되는 함수(호이스팅) function a(){ console.log("선언적함수 테스트"); } $(document).ready(function(){ test(); a(); });
-
미마 마스크kf94 후기일상 2022. 3. 1. 11:43
안녕하세요!~ 오늘은 it 지식 공유 글이 아닌 마스크 공유 글을 작성해보려고 합니다~ 저는 it 직종 종사자 이다 보니.. 사무실에서 장시간 마스크를 쓰고 일을 해야 합니다.(최소 8시간..?) 만약 주말에 카페에서 작업을 하게 된다면 12시간이 넘도록 마스크를 써야 하죠... 마스크를 장시간 쓰다 보면 다른 불편한 점들도 많지만 저는 유독 귀 뒤쪽이 아파지더라고요.. 제가 기존에 쓰던 마스크는 사람들이 가장 많이 사용하는 3중 필터 마스크였습니다. 요제품!!!!!!! 이 제품은 마스크 끈 부분이 얇은 밴딩으로 되어있어서 장시간 마스크를 끼게 되면 귀에 통증이 오는것같아요. (특히 머리가 큰분들.. ㅎ) 그래서 이 마스크를 낄때는 귀통증 완화 후크? 를 사용하는것 같더라고요 ..ㅎ 그런데 저는 그걸 매..