Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

不知为何会WA

Posted by xiao_bin at 2014-10-11 20:38:23 on Problem 2707
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
    int a,b,c,d,i;
    while(cin >> a >> b >> c >> d)
    {
        if(a==0&&b==0&&c==0&&d==0)
            break;
        if(a>b)
        {
            int t=a;
            a=b;
            b=t;
        }
        if(c>d)
        {
            int t=c;
            c=d;
            d=t;
        }
        for(i=100;i>=1;i--)
        {
            double s=i*1.0/100;
            double sa,sb;
            sa=a*s;
            sb=b*s;
            if(sa<=c&&sb<=d)
            {
                break;
            }
        }
        printf("%d",i);
        puts("%");
    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator