#115.”A PRINTER'S ERROR. #In a certain article a printer had to set up the #figures 5^4 * 2^3, which, of course, means that the #fourth power of 5 (625) is to be multiplied by the #cube of 2 (8), the product of which is 5,000. But #he printed 5^4 * 2^3 as 5 4 2 3, which is not correct. #Can you place four digits in the manner shown, so #that it will be equally correct if the printer sets #it up aright or makes the same blunder? import math for ii in range(10): for kk in range(10): for jj in range(10): for mm in range(10): if math.pow(ii,kk) * math.pow(jj,mm) == (ii*10+kk)*100+(jj*10+mm): print ii,kk,jj,mm
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question