早教吧 育儿知识 作业答案 考试题库 百科 知识分享

求一个简单的完整C程序答案Inthetelevisionprogram"ShoppingStreet"ofCCTV-2,twopeople,AandBareguessingpriceofagivenitem.Youareaskedtodecidewhosepriceisclosertotherealprice.输入Therearemultipletestcases.Thef

题目详情
求一个简单的完整C程序答案
In the television program "Shopping Street" of CCTV-2,two people,A and B are guessing price of a given item.You are asked to decide whose price is closer to the real price.
输入
There are multiple test cases.The first line of input is an integer T (T
▼优质解答
答案和解析
#include
#include
void main()
{int P,PA,PB,n;
scanf("%d",&n);
while(n--)
{scanf("%d %d %d",&P,&PA,&PB);
if(fabs(P-PA)