0
c# question
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 "); } } } } I'm interested in how to make 2 letters, not 1, appear after the word. Example: ball displays allbay, but I wonder how to make llabay be displayed. Console.Write (word [0]); Console.Write (word [1]); Does not help.
4 Antworten
+ 1
Here is an example based on your code
https://code.sololearn.com/cWj96nC0N1wF/?ref=app
if you want to reverse the letters please give me a sign
0
foreach (var word in y)
{
for (int i=2; i<word.Length; i++)
{
Console.Write (word[i]);
}
Console.Write(word[1]); Console.Write(word[0]);
Console.Write ("ay ");
Is this not working?
0
Everything works.
0
Strange, I did it, but it didn’t work out for me.