• + 1 comment

    i have got only so:

    for(int i=1;i<=n;sum+=(n%i==0?i:0),i++);