Biranchi
BAN USER
Comments (3)
Reputation -5
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-1
of 1 vote
static void Main()
{
string inputString = "H i t h e re! Is t hi s ev en p o s sib le?";
char[] chars = inputString.ToCharArray();
for (int i = chars.Length - 1; i > 0; i--)
{
while (chars[i] != ' ')
{
i--;
}
int j = i;
while (chars[j] == ' ' && j > 0)
{
j--;
}
chars[i] = chars[j];
chars[j] = ' ';
}
foreach (char c in chars)
Console.Write(c);
Console.ReadKey();
}
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
- Biranchi June 25, 2013