Notice
Recent Posts
문제 풀이 및 개발 공간
[백준] 5671번 호텔 방 번호 문제! (silver 5 본문
import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer st;
String input="";
while((input= br.readLine()) != null){
st=new StringTokenizer(input);
int total=0;
int start=Integer.parseInt(st.nextToken());
int end=Integer.parseInt(st.nextToken());
int[] num;
for(int i=start; i<=end; i++){
String a=String.valueOf(i);
num=new int[10];
for(int j=0; j<a.length(); j++){
num[a.charAt(j)-'0']++;
if(num[a.charAt(j)-'0']>1){
break;
}
else if(j==a.length()-1){
total++;
}
}
}
bw.write(total+"\n");
bw.flush();
}
}
}
'백준공부 > java' 카테고리의 다른 글
[백준] 23253번 자료구조는 정말 최고야 문제! (silver 5 (0) | 2023.04.16 |
---|---|
[백준] 9095번 1,2,3 더하기 문제! (silver 3 (0) | 2023.04.15 |
[백준] 11726번 2xn 타일링 문제! (silver 3 (0) | 2023.04.15 |
[백준] 11004번 K번째 수 문제! (silver 5 (0) | 2023.04.14 |
[백준] 4335번 숫자 맞추기 문제! (silver 5 (0) | 2023.04.14 |