Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Solution {
  4. public static void main(String[] args) {
  5. try(Scanner in = new Scanner(System.in)) {
  6. int N = in.nextInt();
  7. int sum = 1;
  8. for(int i = 2; i < N; i++) {
  9. if((N % i) == 0) {
  10. sum += i;
  11. System.out.println(i);
  12. }
  13. }
  14. System.out.println("Summation: " + sum);
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement