这里是一道c语言的题目,怎么编写,用最基础的语言.Chicken and rabbits are in a same cage.As we all know,chicken has two legs but rabbit has four.Nowwe know the number of legs in the cage is A,please tell me how many animals may in th
来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 14:39:23
这里是一道c语言的题目,怎么编写,用最基础的语言.Chicken and rabbits are in a same cage.As we all know,chicken has two legs but rabbit has four.Nowwe know the number of legs in the cage is A,please tell me how many animals may in th
这里是一道c语言的题目,怎么编写,用最基础的语言.
Chicken and rabbits are in a same cage.As we all know,chicken has two legs but rabbit has four.Now
we know the number of legs in the cage is A,please tell me how many animals may in the cage at least
and at most.
输入:The first line of the input contains the number of test cases in the file.Each test case that follows
consists of one lines.each case contains only one integer numbers A specifying the total legs in the
cage .
输出:For each test case,print a line contains the answer
这里是一道c语言的题目,怎么编写,用最基础的语言.Chicken and rabbits are in a same cage.As we all know,chicken has two legs but rabbit has four.Nowwe know the number of legs in the cage is A,please tell me how many animals may in th
#include
int main()
{
int n ,T;
scanf("%d",&n);
while(n--)
{
scanf("%d",&T);
if(T%2!=0)
printf("0 0\n");
else
{
if( T % 4 == 0)
printf("%d %d\n",T/4,T/2);
else
printf("%d %d\n",T/4+1,T/2);
}
}
return 0;
}