From the keyboard is introduced a string of natural numbers until the value 0.The problem asks to display all of the triples of consecutive introduced numbers(ex: 2 5 15) that have the following property:
(n2==n1/s && n2==n1%s)&&(n3==n1/s && n3==n1%s),where n1,n2,n3 are forming the triplet and s is the sum of the digits of n1.
In our example we have 1 triplet of numbers:
n1=2 n2=5 n3=15...s=1+5=6...15/6=2 and 15%6=5
I wrote some code,but nothing went well,so please help me.