From 9adc6d8bb7ebcbc6c14c2a1ad3d5bb030a17280d Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Wed, 15 Sep 2021 21:46:55 +0800 Subject: [PATCH] =?UTF-8?q?869.=20=E8=AF=95=E9=99=A4=E6=B3=95=E6=B1=82?= =?UTF-8?q?=E7=BA=A6=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/7745986/ --- AcWing/869/869.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 AcWing/869/869.cpp diff --git a/AcWing/869/869.cpp b/AcWing/869/869.cpp new file mode 100644 index 00000000..ab96f2b3 --- /dev/null +++ b/AcWing/869/869.cpp @@ -0,0 +1,24 @@ +#include + +using namespace std; + +int n, a; + +int main() { + cin >> n; + while (n--) { + set ans; + cin >> a; + for (int i = 1; i * i <= a; i++) { + if (a % i == 0) { + ans.insert(i); + ans.insert(a / i); + } + } + for (int i : ans) { + cout << i << ' '; + } + cout << endl; + } + return 0; +}