问题2872--String Comparator

2872: String Comparator

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

You want to write a revolutionary string comparator that will check whether two strings are equal. You don't want to use the usual comparator because even the best coders make mistakes from time to time. Your new comparator will consider strings s1 and s2 equivalent if they are of equal length, and they differ in at most one position.

输入

One line containing an integer T (T <= 100), the number of test cases in the input file. For each test case, there will be two strings s1 and s2, separated by a space. The string will only contain lowercase letters. The length of them is between 1 and 30 inclusive.

输出

T lines, one for each test case in the order they occur in the input file, each containing the string "Case X: S" where X is the number of the test case, starting from 1, and S is a string: "Yes" if s1 and s2 are considered equivalent with your new comparator, or "No" otherwise.

样例输入 Copy

2
zhejiang icpc
acm acm

样例输出 Copy

Case 1: No
Case 2: Yes

来源/分类