SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
import java.util.Scanner;
import java.io.FileInputStream;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
int T;
T=sc.nextInt();
for(int i=1; i<=T; i++){
if(T%i==0){ System.out.print(i + " ");
}
}
}
}
반복문 1부터 시작해야 한다는 점만 주의
'SWEA' 카테고리의 다른 글
[SWEA] 더블더블 (0) | 2024.09.20 |
---|---|
[SWEA] 1대1 가위바위보 (0) | 2024.09.20 |
[SWEA] 아주 간단한 계산기 (0) | 2024.09.19 |
[SWEA] N줄 덧셈 (0) | 2024.09.19 |
[SWEA] 대각선 출력하기 (0) | 2024.09.19 |