12414 - Calculating Yuan Fen
Solution Description : Ad hoc Problem Example Input: ABC Convert to Number: 012 // For A=0,B=1,C=2,.....Z=25. For ST=1 => (0+1)(1+1)(2+1) => 123 For ST=100 => (0+100)(1+100)(2+100) => 100101102 Repeat the following until 3 digit: add up each pair of consecutive digits, and write down the last digit of each sum. See below 901058610010598 91153471011547 0268718112691 284589923850 02937815135 2120596648 332545202 65799722 1268694 384453 12898 3077 374 For ST=1 to 10000 ---Do the process for input string which is describe above. (For each ST) ---If the 3 digit is 100 then ans = ST break; End For If you do not find any ans in ST=1 to 10000 then print :( |
||||||||||