오늘 한 것
- 자바 스터디
- 윤년 판단 함수
static boolean isLeapYear(int year){
if( year % 4 == 0 && year % 100 != 0){
return true;
}
if(year % 400 == 0){
return true;
}
return false;
}
-
- 별찍기
첫째 줄에는 별 1개, 둘째 줄에는 별 2개, N번째 줄에는 별 N개를 찍는 문제
- 별찍기
private static void printStar(int n) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("*");
}
System.out.println();
}
}
- 알고리즘 코드카타
[프로그래머스] 짝수의 합(Java)
나의 풀이class Solution { public int solution(int n) { int answer = 0; for(int i = 2 ; i 다른 사람의 풀이class Solution { public int solution(int n) { int answer = 0; for(int i=2; i
muerha.tistory.com
- 개인 과제 - 숫자 야구 게임 구현
'TIL' 카테고리의 다른 글
| TIL 241028 (0) | 2024.10.28 |
|---|---|
| TIL 241025 (0) | 2024.10.25 |
| TIL 241023 (0) | 2024.10.23 |
| TIL 241022 (0) | 2024.10.22 |
| TIL 241021 (0) | 2024.10.21 |