Topic Link http://blog.csdn.net/hackbuteer1/article/details/11132567
1. String filtering
Enter a string of lowercase letters (A~Z) through the keyboard. Write a string filter to filter out characters that are not the first occurrence if multiple identical characters appear in the string.
For example, the string "ABACACDE" filter result is "ABCDE".
Solution:HashSet can solve
2. String compression
Enter a string of lowercase letters (A~Z) through the keyboard. Write a string compression program that compresses the repeating letters of successive attendance in a string and outputs the compressed string.
Compression rules:
1. Compress only consecutive occurrences of characters. For example, the string "ABCBC" because there is no continuous repetition of characters, the compressed string is still "ABCBC".
2. The format of the compressed field is "number of characters repeat + characters". For example, the string "XXXYYYYYYZ" is compressed and becomes "3x6yz".
Workaround: There is a pre flag bit that records the preceding character, and a for loop resolves
3. Adding integers
By typing the formula for adding and reducing the number of positive integers within 100, write a program output result string.
The input string is in the following format: operand 1 operator operand 2, operand and operator separated by a space.
Using regular expressions, read by rows