For her 16th birthday, Kate receives a book. On each page whose digits sum to 16, there is one word of a secret birthday message written in the margin. If the book is 2800 pages, how many words are in the secret birthday mesasage?
s=0;p=0;i=1;n=1;m=n;n=m;cycle: s=s+n%10+int(n/10)%10+int(n/100)%10+int(n/1000)%10+int(n/10000)%10+int(n/100000)%10;if(s==16, goto end,goto next); end:p=p+1;printp,"==",m;next:s=0;m=m+1;if(m<2800, goto5, 0);print"Total Num =",p
Output: 204 words