您的位置:首页 > 其它

南阳oj鸡兔同笼

2015-01-11 15:38 232 查看
#include<stdio.h>
int main()
{
int head,foot;
int x,y,N;
scanf("%d",&N);
while(N--){
scanf("%d%d",&head,&foot);
x=(4*head-foot)/2;
y=(foot-2*head)/2;
if(x<0||y<0){
x=0;y=0;}
if((2*x==4*head-foot)||(2*y==foot-2*head))
printf("%d %d\n",x,y);
else
printf("No answer\n");
}
return 0;

}
这是一个简单的程序,话也不多说了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: