You are viewing a single comment's thread. Return to all comments →
Better use ternary for 1 liner if.
struct Calculator : public AdvancedArithmetic { int divisorSum(int n) { int sum = 0; for(int i = n; i > 0; --i) sum += n%i ? 0 : 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 →
Better use ternary for 1 liner if.