You are viewing a single comment's thread. Return to all comments →
c# conditional operator
public int divisorSum(int n) { int sum=0;
for(int i=1;i*i<=n;i++) { var q=Math.DivRem(n,i,out int r); if(r==0) { sum+=i!=q?i+q:i; } } return sum; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
c# conditional operator
public int divisorSum(int n) { int sum=0;