输入第一行为数据组数T (T<=20)。每组数据仅一行,包含三个整数x, y, z (1<=x, y<=10,1<=z<=1000)。
对于每组数据,输出一个整数,即A 太太应得的金额(单位:元)。
2 5 4 90 8 4 123
60 123
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
int m;
double x,y,a,b,m1;
scanf("%lf%lf%d",&x,&y,&m);
double c = (x+y)/3.0;
a = x-c;
b = y-c;
m1 = a/(a+b)*m;
printf("%.0f\n",m1);
}
return 0;
}
5075



被折叠的 条评论
为什么被折叠?



