개발일기/TIL(Since24.04.19)

Java&Spring - TIL(24.05.29 수)

w.llama 2024. 5. 29. 21:08

오늘 한 일

  • 내일배움 캠프
    • Spring 숙련 개인과제 진행
  • 방송대 알고리즘 강의 수강
  • 프로그래머스 문풀
  • HyperSkill 문풀
    • Rrotected modifier
 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

 

다양한 풀이 법

직사각형 별찍기

import java.util.Scanner;

class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        for(int j=0; j<b; j++){
            for(int i =0; i<a; i++){
                System.out.print("*");
            }
            System.out.println();
        }

    }
}
import java.util.Scanner;

class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        for(int i = 0; i < b; i++){
            System.out.println("*".repeat(a));
        }
    }
}

.repeat(a)라는 메소드를 이용하면 간결하게 문제를 풀 수 있다.

내일 할 일

Spring 숙련 개인과제 실시

방송대 알고리즘 수강

프로그래머스/HyperSkill 문풀