def Q(T,Y):O,D=sorted([T,Y]);E=len(`D`);print'%s\n %s\n+%*s\n %s\n %d'%(''.join([' ',i[0]][len(i)>1]for i in[`sum(map(int,u))`for u in zip(`D`,'%0*d'%(E,O))]),D,E,O,'-'*E,sum([T,Y]))exec("Q(*input());print('\\n');"*5)
(123,456) (1234,78) (1289,345) (123,567) (675,3458)
456 +123 --- 579 11 1234 + 78 ---- 1312 11 1289 + 345 ---- 1634 1 567 +123 --- 690 111 3458 + 675 ---- 4133
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!