Write a program that reads a string from standard input. The string will appear on a single line, and will contain no whitespace characters. You may assume that all characters in the string are unique.
Your program should print out all non-empty subsequences of characters that can be formed from the characters in the input string. Write each subsequence on a separate line. The characters in each subsequence must appear in the same order as in the original string. You may write the subsequences in any order.
Important: All of your code must appear in Main(); you may not write any other functions/methods (nested or otherwise). After all, we haven't learned about writing methods in C# yet. :) And so you may not use recursion to solve this problem as we did in Programming 1.
Sample input:
jump
Possible output:
j
u
ju
m
jm
um
jum
p
jp
up
jup
mp
jmp
ump
jump
Hint: If N is the length of the input string, there are 2^N possible subsequences (including the empty sequence). That's because each of the N input letters either is or is not in the output, so there are 2 possibilities for that letter.
There also happen to be 2^N numbers that can be written using N digits in binary representation (i.e. base 2). If you can generate those binary numbers, you can use each one to generate an output string (excepting the empty string).