본문 바로가기

전체 글

(104)
프로그래머스 문자 반복 출력하기 예 class Solution { public String solution(String my_string, int n) { String answer = ""; //변수 my_string에 저장된 문자열을 변환하고 저장할 공간 for(int i =0; i
프로그래머스 짝수 홀수 갯수 예제 class Solution { public int[] solution(int[] num_list) { int A = 0; int B = 0; for(int num : num_list){ if(num % 2 == 0){ A++; }else{ B++; } } int[] answer = {A,B}; return answer; } }
프로그래머스 직각삼각형 예제 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 1; i
프로그레머스 문자열 뒤집기 예제 class Solution { public String solution(String my_string) { String answer = ""; for(int i = my_string.length()-1; i>=0; i--){ //거꾸로 길이5 -1 01234 배열같은느낌... 0까지 1씩 빼버리기 answer += my_string.substring(i, i+1); } return answer; } }
프로그래머스 배열뒤집기 예제 class Solution { public int[] solution(int[] num_list) { int[] answer = new int[num_list.length]; for(int i = 0; i
프로그래머스 나이 출력 예제 class Solution { public int solution(int age) { int currentYear = 2022; int birth = 2022-age+1; int answer = birth; return answer; } }
프로그래머스 아이스아메리카노 예제 class Solution { public int[] solution(int money) { int[] answer = {money/5500,money%5500}; return answer; } }
pk와fk 그리고 inner join문 use practice; Create table employees( employee_id int(50) auto_Increment, employee_name varchar(50), employee_age int(100), primary key (employee_id) ); insert into employees(employee_id,employee_name,employee_age) value(1,'김하나',19); insert into employees(employee_id,employee_name,employee_age) value(2,'안철수',35); insert into employees(employee_id,employee_name,employee_age) value(3,'문재인',40); se..