http://acm.hdu.edu.cn/showproblem.php?pid=1194

跟着狗畅找了道水题做,他真无聊啊。。。

View Code
#include <iostream>
using namespace std ;
int main()
{
    int n,i;
    int s,d;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d%d",&s,&d);
        for(i=s;i>0;i--)
            if(abs(i*2-s)==d)
            {
                printf("%d %d\n",i,s-i);
                break;
            }
        if(i==0)
            puts("impossible");
    }
    return 0;
}

 

相关文章:

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