0
I need help completing this code
using System; using System.Collections.Generic; namespace Code_Coach_Challenge { class Program { static void Main(string[] args) { string[] words = { "home", "programming", "victory", "C#", "football", "sport", "book", "learn", "dream", "fun" }; string letter = Console.ReadLine(); foreach (var word in words) { if (word.Contains(letter)) { Console.WriteLine(word); } } } } }
2 Antworten
+ 1
Thanks 👍👍👍
0
Well in case the the input letter isn't found on any of words in the array, it supposed to print "Not found".
When first attempted, it printed that for every word it didn't find the input letter except for the once that have the letter in them.