#include <iostream>

int main() {
    int n;
    int w = 0;
    scanf("%d",&n);
    for(int i = 1;i <= n;i++){
        if(n % i == 0){
            w += i;
        }
    }
    printf("%d",w);
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: