I have a 4-line poem. I read this poem line by line from the text, flip the sentence over and assign it to the array. The purpose of my inversion is to find the rhymes at the end of the poem. In my code I try to find the word ryhme. For example - Lifting her arms to soap hair
"She wrings the water from her hair. Here is the word rhyme hair. I put the hair in the array by letter by letter. But when I want to show it on the console, the output does not appear. Where do I go wrong?" //
string[] ss2 = new string[reversed.Length-1];
bool flagword = false;
int sayac = 0;
for (i = 0; i < linenum - 1; i++) //word
{
int k = 0;
while (reversed[i].Substring(k, 1) == reversed[i + 1].Substring(k, 1))
{
ss2[i] += reversed[i].Substring(k, 1);
k++;
flagword = true;
}
if (reversed[i].Substring(k, 1) == " ") sayac++;
}
if (flagword && sayac != 0)
{
Console.WriteLine(ss2[1]);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…