inblog logo
|
sxias
    Programmers_CT

    [Programmers_CT] 27. 문자열 돌리기

    문정준's avatar
    문정준
    Mar 21, 2025
    [Programmers_CT] 27. 문자열 돌리기
    Contents
    1. 문제 설명2. 입출력 예시3. 코드 작성4. 테스트 실행5. 제출 후 채점
     
    💡
    프로그래머스 코딩 테스트 25. 문자열 돌리기

    1. 문제 설명

    notion image
     

    제한 사항

    notion image

    2. 입출력 예시

    notion image

    3. 코드 작성

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); for(int i=0;i<a.length();i++) System.out.println(a.charAt(i)); } }
    ✏️

    문자열 돌리기 : 한 글자씩 세로로 출력

    • 문자열 a의 길이만큼 반복문 사용, a의 i번째 글자를 반복해서 출력
      • for(int i=0;i<a.length();i++) System.out.println(a.charAt(i));

    4. 테스트 실행

    notion image

    5. 제출 후 채점

    notion image
    Share article
    Contents
    1. 문제 설명2. 입출력 예시3. 코드 작성4. 테스트 실행5. 제출 후 채점

    Sxias ㆍ a32176740@gmail.com

    RSS·Powered by Inblog