
跪求C++编程高手给编个程序~感激不尽 40
Program1:IamLordVoldemortIfyouhaveeverreadHarryPotter,youwouldknowthattheevilandpower...
Program 1: I am Lord Voldemort
If you have ever read Harry Potter, you would know that the evil and powerful wizard, Lord Voldemort, create this name by permuting his original name, "Tom Marvolo Riddle", to "I am Lord Voldemort".
Write a program to check whether it is possible to transform a given word to another by permuting its letters.
Input Format: (a1.in)
The first line is an integer T, the number of test cases. Following T lines each contains two words separated by spaces.
Output Format: (a1.out)
For each test case, Output on a line "Yes" if it is possible to do the transformation, otherwise output "No" instead.
Notes
• Permuting a word is to change the order of its letters, but no new letters can be added and no original letters can be deleted. For example, one can transform "aabc" to "abca", but not to "bac", "abc", "aabca", "aacbb".
• Words will contain letters only('a'-'z', 'A'-'Z').
• A word won't contain any white spaces in itself.
• The given two words will not be the same.
• You should ignore case when comparing words, i.e. 'a' is the same as 'A', 'b' is the same as 'B', etc.
Constraints
• The length of any given word is greater than 0 and no larger than 50.
Sample Input:
4
TomMarvoloRiddle IamLordVoldemort
stop pots
abbc bac
InternetAnagramServer IRearrangementServant
Sample Output:
Yes
Yes
No
Yes
多说一下:要用Visual C++编写~~拜托了~
下周就交了~~高手们~帮帮忙吧~题目的大概意思就是输入两个词~看其中的字母是否相同~顺序无所谓~只要是字母相同就输出YES~不同输出NO~~ 展开
If you have ever read Harry Potter, you would know that the evil and powerful wizard, Lord Voldemort, create this name by permuting his original name, "Tom Marvolo Riddle", to "I am Lord Voldemort".
Write a program to check whether it is possible to transform a given word to another by permuting its letters.
Input Format: (a1.in)
The first line is an integer T, the number of test cases. Following T lines each contains two words separated by spaces.
Output Format: (a1.out)
For each test case, Output on a line "Yes" if it is possible to do the transformation, otherwise output "No" instead.
Notes
• Permuting a word is to change the order of its letters, but no new letters can be added and no original letters can be deleted. For example, one can transform "aabc" to "abca", but not to "bac", "abc", "aabca", "aacbb".
• Words will contain letters only('a'-'z', 'A'-'Z').
• A word won't contain any white spaces in itself.
• The given two words will not be the same.
• You should ignore case when comparing words, i.e. 'a' is the same as 'A', 'b' is the same as 'B', etc.
Constraints
• The length of any given word is greater than 0 and no larger than 50.
Sample Input:
4
TomMarvoloRiddle IamLordVoldemort
stop pots
abbc bac
InternetAnagramServer IRearrangementServant
Sample Output:
Yes
Yes
No
Yes
多说一下:要用Visual C++编写~~拜托了~
下周就交了~~高手们~帮帮忙吧~题目的大概意思就是输入两个词~看其中的字母是否相同~顺序无所谓~只要是字母相同就输出YES~不同输出NO~~ 展开
4个回答
展开全部
你先把他翻译成中文不行吗
其实高手是不会来这里的,高手也怕麻烦的
其实高手是不会来这里的,高手也怕麻烦的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询