Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Ако judge не дава 100 точки на това решение,
- * възможна причина е, че като попадне на еднакви стрингове
- * печата този от втория масив
- * и след него лепва интервал.
- * След последния стринг обаче може да иска
- * да няма такъв интервал */
- string[] inputOne = Console.ReadLine()
- .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- string[] inputTwo = Console.ReadLine()
- .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- for (int i = 0; i < inputTwo.Length; i++)
- {
- string currentFromSecond = inputTwo[i];
- for (int j = 0; j < inputOne.Length; j++)
- {
- string currentFromFirst = inputOne[j];
- if(currentFromSecond.Equals(currentFromFirst))
- {
- Console.Write("{0} ", currentFromSecond);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment