输入第一行为数据组数T (T<=20)。每组数据仅一行,包含三个整数x, y, z (1<=x, y<=10,1<=z<=1000)。
Output对于每组数据,输出一个整数,即A 太太应得的金额(单位:元)。
Sample Input 2 5 4 90 8 4 123 Sample Output 60 123 这题就是陈c太太的三个人平均的工作时间,多出来的就是他们的工资了#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; }