I'll play a trick on you
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2578 Accepted Submission(s): 731
Please never doubt the picture.

Each case contains two integers A,B (1<=B<=A<=10100)
3 99 72 45 27 39 18
Case 1: 27 Case 2: 18 Case 3: 21HintIf you have any idea to work out the ? and explain why but couldn't get Accepted , please email me (notonlysuccess@gmail.com), the first person will get 100RMB from me.
这种题,各种yy。一开始估计很多人都想到“?”是15,即两数相减,但是这样最后应该是8而不是7 。所以果断是错误的yy。
我也经历了各种错误的yy,真是惭愧,最后还是去google了一下,找到这个看起来比较靠谱的yy,而这个也刚好是题目正确的yy:
99 = 9 + 9 = 18,72 = 7 + 2 = 9,18 + 9 = 27;
45 = 4 + 5 = 9, 27 = 2 + 7 = 9,9 + 9 = 18;
39 = 3 + 9 = 12,18 = 1 + 8 = 9,12 + 9 = 21;
。。。。。。。
这样,最后的7也可以解释了:21 = 2 + 1 = 3,13 = 1 + 3 = 4,3 + 4 = 7
所以,“?”应该是12
代码:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
string sa, sb;
cin >> t;
for (int k = 1; k <= t; k++)
{
cin >> sa >> sb;
int a = 0, b = 0;
for (int i = 0; i < sa.size(); i++)
a += sa[i] - '0';
for (int i = 0; i < sb.size(); i++)
b += sb[i] - '0';
cout << "Case " << k << ": " << a+b << endl;
}
}
1387



被折叠的 条评论
为什么被折叠?



