Guest User

Untitled

a guest
Sep 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication12
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int d = 2;
  15. int sqrSum = 0;
  16. while (n!= 1)
  17. {
  18. while(n % d == 0)
  19. {
  20. n /= d;
  21. sqrSum += d * d;
  22. }
  23. d++;
  24. }
  25.  
  26. Console.WriteLine(sqrSum);
  27.  
  28.  
  29. }
  30. }
  31. }
Add Comment
Please, Sign In to add comment