Ước của một số

View as PDF



Problem types
Allowed languages
Assembly, Awk, Brain****, C, C++, Java, Pascal, Perl, Python, SCRATCH, Sed, Text
Points: 900 (p) Time limit: 1.0s Memory limit: 1G Input: stdin Output: stdout

Một số nguyên \(K\) là ước của \(N\) nếu \(N\) chia hết cho \(K\).
Cho số nguyên dương \(N\). (\(N\) \(\leq 10^6\)).

Yêu cầu

Hãy tìm và in ra màn hình các ước số của \(N\).

Dữ liệu vào

Nhập số nguyên \(N\) từ bàn phím.

Kết quả

In ra các ước theo thứ tự tăng dần về giá trị

Sample
Input
12
Output
1 2 3 4 6 12

Comments

Most recent
Loading comments...

There are no comments at the moment.