+ 2

C# PROJECT 3: WORDS

"Words The program you are given defines an array with 10 words and takes a letter as input. Write a program to iterate through the array and output words containing the taken letter. If there is no such word, the program should output "No match". Sample Input u Sample Output fun Recall the Contains() method." >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(); int count = 0; //your code goes here int condition = 0; for (int i = 0; i<words.Length; i++){ if (words[i].Contains(letter)){ Console.WriteLine(words[i]); continue; } else {condition++;} } if (condition == words.Length) {Console.WriteLine("No match");} } } } GAH!!! I DID IT!!! IT'S MAKESHIFT AND LOOKS AND READS LIKE CRAP BUT IT WORKS!!! I'M SO SLEEPY RIGHT NOW IT TOOK ME 3 HOURS ON AND OFF TO MAKE THIS ACCURSED THING WORK WHY IS C# SO HARD AAAAAAGH!!?

18th Oct 2023, 7:27 AM
21kHzBANK21kHZ
21kHzBANK21kHZ - avatar
2 odpowiedzi
+ 2
You don't need these two lines: int count = 0; continue; Congrats on solving your problem (👉゚ヮ゚)👉
18th Oct 2023, 5:28 PM
SoloProg
SoloProg - avatar
+ 1
@SoloProg ty that stuff was left over from when i was experimenting with other ways to accomplish this task! 😁
19th Oct 2023, 3:26 AM
21kHzBANK21kHZ
21kHzBANK21kHZ - avatar