HDU

来源:互联网 发布:js createevent 编辑:程序博客网 时间:2024/06/05 17:56
#include<stdio.h> int g(int x) { int i;     int count = 0;     for(i = 1;i<=x;++i)     if(x%i==0)     count++;     return count; } int main( )  {     int n,a,b,i;     scanf("%d",&n);     while(n--)  {         scanf("%d%d",&a,&b);         int res = a;         for(i = a;i<=b;++i)         { if(g(i)>g(res))             res = i;         }     printf("%d\n",res);     }     return 0; }