pig latin | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
24th Mar 2020, 8:18 PM
GAG98
GAG98 - avatar
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"); } } } }
25th Mar 2020, 9:20 PM
GAG98
GAG98 - avatar
+ 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 :)
24th Mar 2020, 8:59 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
now not displayed with a space
25th Mar 2020, 9:21 PM
GAG98
GAG98 - avatar
0
Man the design of your code is very uselful
26th Mar 2020, 6:39 AM
Nightcore Safe Heaven
Nightcore Safe Heaven - avatar
0
I have used it in about 5 code couches thanks alot
26th Mar 2020, 6:39 AM
Nightcore Safe Heaven
Nightcore Safe Heaven - avatar
0
Add a space after "ay" in last line
26th Mar 2020, 6:40 AM
Nightcore Safe Heaven
Nightcore Safe Heaven - avatar