a005.
Eva 的回家作業
--
POJ
| From: [1.173.209.6] |
發表日期
:
2012-12-24 23:18
#include<stdio.h>
int main(){
int a,b,c,d,e,n;
scanf("%d",&n);
for(e=0;e<n;e++){
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a+d==b+c)
printf("%2d%2d%2d%2d%2d\n",a,b,c,d,d+b-a);
else if(a*d==b*c)
printf("%2d%2d%2d%2d%3d\n",a,b,c,d,d*(b/a));
else 0;
}
}