Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Arrays
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> specialWords = new List<string>();
- List<string> otherWords = new List<string>();
- int countWords = int.Parse(Console.ReadLine());
- for (int count = 1; count <= countWords; count++)
- {
- string word = Console.ReadLine();
- //проверка дали е специална
- if((word[0] >= 'A' && word[0] <= 'Z') && (word.Contains('i') || word.Contains('I')) && word.Length > 7)
- {
- //специална дума
- specialWords.Add(word);
- }
- else
- {
- //не е специална
- otherWords.Add(word);
- }
- }
- Console.WriteLine("Special words: " + string.Join(", ", specialWords));
- Console.WriteLine("Other words: " + string.Join(", ", otherWords));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement