One of the system of calculating word value is Hebrew Numerology, in which corresponding numeric value of letter (1 to 26 for A to Z) are joined together. A “Happy Word” is a word whose eventual sum of square of the digits of its word value is equal to 1. Write a program to input a word and check whether it is a Happy Word or not. The program displays a message accordingly.
Sample Input: VAT
Place value V=22, A=1, T=20
Solution: 22120 => 2^2+2^2+1^2+2^2+0=13 =>1^2+3^2=10 => 1^2+0=1
Sample Output: A Happy Word