hdu 5924.Mr. Frog’s Problem

http://acm.hdu.edu.cn/showproblem.php?pid=5924

题意:输入A,B,要求A≤C,D≤B,A/B+B/A≤C/D+D/C,求符合要求的C,D有几个

直接输出就好了,A和B一样就输出一个,不一样就是两个,一正一反,水

 1 #include<iostream>
 2 #include<string>
 3 using namespace std;
 4 int main()
 5 {
 6     int n,i=1;
 7     string s1,s2;
 8     cin >> n;
 9     while(n--&&cin >> s1 >> s2)
10     {
11         cout << "Case #"<<i++<<":"<<endl;
12         if(s1!=s2)
13         {
14             cout << 2<<endl;
15             cout << s1 << " "  << s2 << endl;
16         cout << s2 << " " <<s1 << endl;
17         }
18         else
19         {
20             cout << 1 <<endl;
21             cout << s1 << " "  << s2 << endl;
22         }
23     }
24     return 0;
25 }

猜你喜欢

转载自www.cnblogs.com/icfir/p/9022409.html