Đây là lời giải của mình đã AC. Nếu bạn đã cố gắng mà chưa làm được thì có thể tham khảo lời giải của mình.
Xem code AC
```cpp
#include
using namespace std;
long n,d=0;
int main()
{
cin>>n;
for (long i=1;i<=sqrt(n);i++)
{
if (n%i==0) {d+=i;d+=(n/i);}
}
long k=sqrt(n);
if (k*k==n) {d-=k;}
cout<
Chi tiết bài tập - Luyện Code Online
https://luyencode.net/problem/SUMNUM