Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Lists
- {
- class Program
- {
- static bool ContainsE(string text)
- {
- foreach (var item in text)
- {
- if (item == 'e')
- {
- return true;
- }
- }
- return false;
- }
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- List<string> special = new List<string>();
- List<string> other = new List<string>();
- for (int i = 0; i < n; i++)
- {
- string word = Console.ReadLine();
- if (word[0] != word[word.Length - 1]
- && ContainsE(word)
- && word.Length > 5)
- {
- special.Add(word);
- }
- else
- {
- other.Add(word);
- }
- }
- Console.WriteLine($"Special words: {string.Join(",", special)}");
- Console.WriteLine($"Other words: {string.Join(",", other)}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement