➜ 코딩 테스트/프로그래머스

프로그래머스 - 덧셈식 출력하기

HTML 삽입 미리보기할 수 없는 소스 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = a + b; System.out.println(a + " + " + b + " = " + c); } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 특수문자 출력하기

HTML 삽입 미리보기할 수 없는 소스 import java.util.Scanner; public class Solution { public static void main(String[] args) { String str = ""; str = "!@#$%^&*(" + "\\" + "'" + '"' + "?:;"; System.out.println(str); } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 대소문자 바꿔서 출력하기

HTML 삽입 미리보기할 수 없는 소스 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String answer = ""; for( int i = 0; i < a.length(); i++){ char str = a.charAt(i); if(Character.isUpperCase(str)){ answer += Character.toLowerCase(str); }else{ answer += Character.toUpperCase(str); } } System.out.println(answer..

➜ 코딩 테스트/프로그래머스

프로그래머스 - 문자열 반복해서 출력하기

HTML 삽입 미리보기할 수 없는 소스 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); int n = sc.nextInt(); for(int i = 0; i < n; i++){ System.out.print(str); } } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - a와 b 출력하기

HTML 삽입 미리보기할 수 없는 소스 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); System.out.println("a = " + a); System.out.println("b = " + b); } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 문자열 출력하기

HTML 삽입 미리보기할 수 없는 소스 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); System.out.println(a); } }

➜ Java

리스트(List)와 문자열 배열(String Array)의 차이점 (feat. 배열 원소제거하기)

리스트(List)와 문자열 배열(String Array)의 차이점 (feat. 배열 원소제거하기) Java에서 데이터를 저장하고 관리하는 데에는 여러 가지 방법이 있다. 그 중에서도 리스트(List)와 문자열 배열(String Array)는 많이 사용되는 방식이다. 리스트와 문자열 배열에 대해서 알아보고 두 가지의 차이점에 대해서 정리해 보겠다 리스트(List) 리스트는 크기가 가변적이다. 요소의 개수를 동적으로 조정할 수 있다. 리스트는 여러 종류의 객체를 저장할 수 있다. 예를 들어 정수, 문자열, 객체 등을 저장할 수 있다. 리스트는 요소의 추가, 삭제, 수정이 용이하다. 'add()', 'remove()', 'set()' 등의 메소드를 사용하여 요소를 조작할 수 있다. ArrayList, Link..

➜ 코딩 테스트/프로그래머스

프로그래머스 - 문자열 붙여서 출력하기

프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr HTML 삽입 미리보기할 수 없는 소스 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); System.out.println(a+b); } }

➜ 코딩 테스트/프로그래머스

프로그래머스 - 길이에 따른 연산

프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr HTML 삽입 미리보기할 수 없는 소스 class Solution { public int solution(int[] num_list) { int sum = 0; int mul = 1; int answer = 0; for(int i = 0; i = 11){ sum += num_list[i]; answer = sum; }else{ mul *= num_list[i]; answer = mul; } } return answer; } }

➜ 기타

티스토리 테마 다크모드 오류

다크모드로 이용하면 몇 글자가 흰색으로 처리되지 않고 검은색으로 나오는 오류가 있습니다 글씨가 잘 나오지 않는다면 라이트 모드로 써주세요!

강맹석
맹석의 IT노트 & 일상 기록