Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int numSquareSum(int n)
- {
- int squareSum = 0;
- int digit = 0;
- while (n!= 0)
- {
- digit = n % 10;
- squareSum += digit * digit;
- n /= 10;
- }
- return squareSum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement