Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
<br>#include <stdio.h>
int
f[9]={0,10,100,1000,10000,100000,1000000,10000000,100000000};
int
main()
{
int
a,b,n;
while
(
scanf
(
"%d%d%d"
,&a,&b,&n),a||b)
{
if
(a%f[n]==b%f[n])
printf
(
"-1\n"
);
else
printf
(
"%d\n"
,a+b);
}
}
|
本文转自ZH奶酪博客园博客,原文链接:http://www.cnblogs.com/CheeseZH/archive/2012/05/13/2497969.html,如需转载请自行联系原作者