-
카테고리
-
세부 분야
알고리즘 · 자료구조
-
해결 여부
미해결
1-1 왜 런타임 에러가 나오는지 모르겠습니다
24.01.17 16:07 작성 24.01.17 16:09 수정 조회수 102
0
package org.example;
import java.util.Scanner;
import static java.lang.Character.*;
public class Main {
public static int solution(String str, String ch){
int result = 0;
for(int i = 0; i < str.length(); i++){
if(toLowerCase(str.charAt(i)) == toLowerCase(ch.charAt(0))){
result++;
}
}
return result;
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String str = scanner.next();
String ch = scanner.next();
System.out.println(solution(str, ch));
}
}
IDE에서는 정상적으로 실행되는데
채점사이트에서는 런타임에러가 나네요 ㅠㅠ
이유를 모르겠습니다
답변을 작성해보세요.
0
답변 1