Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Practice
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] words = { "life", "love", "money", "luck", "chess", "snake" };
- var count = 0;
- char letter = Convert.ToChar(Console.ReadLine());
- foreach(var i in words)
- {
- if (i.Contains(letter)) { Console.WriteLine(i); }
- else { count++; }
- }
- if (count == words.Length) { Console.WriteLine("No match"); }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement