| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
高人指点,为什么WA?????????谢谢#include <stdio.h>
double MAX(double a, double b);
double MIN(double a, double b);
int main(void)
{
double a, b, c, d, m, n;
while (1) {
scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
if (a == 0.0 || b == 0.0 || c == 0.0 || d == 0.0)
break;
if (MIN(a, b) <= MIN(c, d) &&
MAX(a, b) <= MAX(c, d)) {
printf("100%\n");
}
else {
m = MIN(c, d)/MIN(a, b);
n = MAX(c, d)/MAX(a, b);
if ((m - n) < 0.0)
printf("%d%c\n", (int)(m*100), '%');
else
printf("%d%c\n", (int)(n*100), '%');
}
}
return 0;
}
double MIN(double a, double b)
{
return (a < b) ? a : b;
}
double MAX(double a, double b)
{
return (a > b) ? a : b;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator