비트교육_단기과정 알고리즘 2번 문제 - package week_4; import java.util.*; public class SecondExam { public static void main(String[] args) { Scanner sc = new Scanner(System.in); SecondExam.result(sc.nextInt(), sc.nextInt()); } public static void result(int x, int y) {// x = 100, y = 600 ArrayList<Integer> al = new ArrayList<Integer>(); for (int i = x + 1; i < y; i++) {// 101~ 599 String ti = String.valueOf(i);// ti = 101 for (int j = 0; j < ti.length(); j++) {// 3 if (j == ti.length() - 1) { al.add(i); break; } else if (Character.compare(ti.charAt(j), ti.charAt(j + 1)) >= 0) { break; } } } for (int i = 0; i < al.size(); i++) { System.out.print(al.get(i) + " "); } System.out.println(); System.out.println("갯수:" + al.size()); }} Colored by Color Scriptercs 공유하기 URL 복사카카오톡 공유페이스북 공유엑스 공유 게시글 관리 구독하기'기'발하고 '창'의적인 블로그 Contents 당신이 좋아할만한 콘텐츠 야구게임 1000번 평균횟수 5회 2022.07.13 알고리즘 3번 : 마기창 2022.07.12 알고리즘 1번 문제 2022.07.11 로또 : 마기창 2022.07.11 댓글 0 + 이전 댓글 더보기