Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://www.hackerrank.com/challenges/30-interfaces/
- //Write your code here
- class Calculator : AdvancedArithmetic
- {
- public int divisorSum(int n){
- int sum = 0;
- for(int i = 1; i <= n; i++){
- if(n % i == 0){
- sum += i;
- }
- }
- return sum;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement