1 #include<stdio.h>
 2 #include<math.h>
 3 int main()
 4 {
 5     int a,b,k,s; 
 6     while(scanf("%d%d%d",&a,&b,&k))
 7     {
 8       if(a==0&&b==0)
 9       break;
10       s=pow(10.0,k);  //计算x的y次幂,x应大于零,返回幂指数的结果
11       if(a%s==b%s)
12       printf("-1\n");
13       else printf("%d\n",a+b);
14     }
15 return 0;
16 }

相关文章:

  • 2021-05-17
  • 2021-10-07
  • 2021-08-01
  • 2021-08-03
  • 2021-09-01
  • 2021-11-07
  • 2022-01-04
猜你喜欢
  • 2021-08-28
  • 2022-12-23
  • 2022-01-03
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-04-15
相关资源
相似解决方案