+ 1
pig latin
whats wrong? https://code.sololearn.com/cKa4M3ATS8e6/?ref=app
6 Answers
+ 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
string x= Console.ReadLine();
string [] y= x.Split(' ');
foreach (var word in y)
{
for (int i=1; i<word.Length; i++)
{
Console.Write (word[i]);
}
Console.Write (word[0]);
Console.Write ("ay");
}
}
}
}
+ 1
Hello GAG98
Line 14: You have to remove the space: Console.ReadLine();
(I think it is a bug in code playground)
Line 18: < word.Length not <=
Index starts at 0, so the last index is length - 1.
The code should work now :)
+ 1
now not displayed with a space
0
Man the design of your code is very uselful
0
I have used it in about 5 code couches thanks alot
0
Add a space after "ay" in last line