首页 > 代码库 > HDU5924 Mr. Frog’s Problem

HDU5924 Mr. Frog’s Problem

 1 /*
 2  HDU5924 Mr. Frog’s Problem
 3  http://acm.hdu.edu.cn/showproblem.php?pid=5924
 4  数论
 5  *
 6  */
 7 #include <cstdio>
 8 int main()
 9 {
10     long long a,b;
11     int t;
12     scanf("%d",&t);
13     for(int k=1;k<=t;k++)
14     {
15         scanf("%lld%lld",&a,&b);
16         printf("Case #%d:\n",k);
17         if(a==b)
18         {
19             printf("1\n");
20             printf("%lld %lld\n",a,b);
21         }
22         else
23         {
24             printf("2\n");
25             if(a<b)
26             {
27                 printf("%lld %lld\n",a,b);
28                 printf("%lld %lld\n",b,a);
29             }
30             else
31             {
32                 printf("%lld %lld\n%lld %lld\n",b,a,a,b);
33             }
34         }
35 
36     }
37     return 0;
38 }

 

HDU5924 Mr. Frog’s Problem