1 5 10 15 20
200.00
#include<stdio.h>
int main(){
int
test,m,x,y,z;
double s;
scanf("%d",&test);
while(test--){
scanf("%d %d
%d
%d",&m,&x,&y,&z);
if(x<y&&y<z){
s=m*x*1.0/(y-x)*z;
//类型转换时这个1.0不能省略,这里由int型转换为float型。。。
printf("%.2lf\n",s);
}
}
return 0;
}
此题在提交的时候不可以使用c与c++混合使用,否则nyoj不给你通过。。。
原文:http://www.cnblogs.com/dreamgoing/p/3587011.html