728x90
반응형
- [프로그래머스 코딩테스트] java Lv.0 원소들의 곱과 합chantlemanimport java.lang.Math;class Solution { public int solution(int[] num_list) { int answer = 0; int gop =1; int hap=0; for(int i=0;i
- 2024-10-17 19:49:27
- [프로그래머스 코딩테스트] java Lv.0 주사위 게임2chantlemanimport java.lang.Math;class Solution { public int solution(int a, int b, int c) { int answer = 0; if(a!=b && b!=c && a!=c){ answer=a+b+c; } else if(a==b&& b==c&& a==c){ answer = (a+b+c)*(int)(Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2))*(int)(Math.pow(a,3)+Math.pow(b,3)+Math.pow(c,3)); } else{ answer = (a+b+c)*(int)(Math..
- 2024-10-17 19:33:59
- [프로그래머스 코딩테스트] java Lv.0 등차수열의 특정한 항만 더하기chantlemanclass Solution { public int solution(int a, int d, boolean[] included) { int answer = 0; for(int i=0;i
- 2024-10-17 19:21:27
- [프로그래머스 코딩테스트] java Lv.0 코드처리하기chantlemanclass Solution { public String solution(String code) { String answer = ""; boolean mode = false; for(int i=0;i
- 2024-10-17 19:11:25
- [프로그래머스 코딩테스트] java Lv.0 겹치는 선분의 길이chantlemanclass Solution { public int solution(int[][] lines) { int answer = 0; int cnt[]= new int[201]; for(int[] line:lines) { int start = line[0]+100; int end = line[1] +100; for(int i=start;i1) answer++; } return answer; } }
- 2024-08-27 09:44:47
- [프로그래머스 코딩테스트] java Lv.0 분수의 덧셈chantlemanclass Solution { public int[] solution(int numer1, int denom1, int numer2, int denom2) { int numer = numer1 * denom2 + numer2 * denom1; int denom = denom1* denom2; //최대공약수 구하기 int max = 1; for(int i=1;i
- 2024-08-27 09:33:06
- [프로그래머스 코딩테스트] java Lv.0 다음에 올 숫자chantlemanclass Solution { public int solution(int[] common) { int answer = 0; int a = common[0]; int b = common[1]; int c = common[2]; if(b-a == c-b) answer = common[common.length-1] + b-a; //등차 else answer = common[common.length-1]*(b/a); //등비 return answer; } }
- 2024-08-26 09:48:10
- [프로그래머스 코딩테스트] java Lv.0 최빈값 구하기chantlemanimport java.util.*; class Solution { public int solution(int[] array) { int answer = 0; Map map = new HashMap(); for(int num:array) { int cnt=0; if(map.containsKey(num)) cnt=map.get(num); map.put(num,++cnt); } Iterator it = map.keySet().iterator(); int max=-1; ..
- 2024-08-26 09:41:45
728x90
반응형
스킨 업데이트 안내
현재 이용하고 계신 스킨의 버전보다 더 높은 최신 버전이 감지 되었습니다. 최신버전 스킨 파일을 다운로드 받을 수 있는 페이지로 이동하시겠습니까?
("아니오" 를 선택할 시 30일 동안 최신 버전이 감지되어도 모달 창이 표시되지 않습니다.)