import java.util.Scanner;

public class test2 {

        public static void main(String[] args) {

                Scanner sc = new Scanner(System.in);
                System.out.println("출력");
                String str = sc.next();
                int num = Integer.parseInt(str);


                for (int i = 1; i <=9; i++) {
                        if (i%num==0) {
                                System.out.print(i);
                                System.out.println();
                        }
                        else if (i%num!=0) {
                                System.out.print(i);
                        }
                                
                }
                sc.close();

        }
}

했더니 됩니다 ㅠㅠ 나는 소질이 없나봅니다 ㅠㅠ
for문 두개 쓰는 방법도 생각해볼게여 차칸 프갤러횽들ㅠㅠ