andre_joy

导航

hdu 1701

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1701

题意:求两个百分数对应的人数不想等的最小总人数。(纯属扯淡的题目。。。)

mark:简单搜索。

代码:

#include <stdio.h>

int main()
{
    int n,i;
    double a,b;
    scanf("%d", &n);
    while(n-- && scanf("%lf%lf", &a, &b))
    {
        for(i = 2; i < 10000; i++)
            if((int)(i*a/100.0) != (int)(i*b/100.0)) break;
        printf("%d\n", i);
    }
    return 0;
}

posted on 2012-06-30 20:20  andre_joy  阅读(81)  评论(0编辑  收藏  举报