Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace apps
- {
- class Program
- {
- static int GetInt() { return int.Parse(Console.ReadLine()); }
- static string Get() { return Console.ReadLine(); }
- static void Main()
- {
- int N = GetInt();
- List<string> messages = new List<string>();
- for (int i =0; i<N; i++)
- {
- string given = Get();
- List<string> Separate = given.Split(' ').ToList();
- string name = Separate.Find(n => n.Contains("@") && n.Contains("|")).Replace("@", "").Replace("|","") ;
- int age = int.Parse(Separate.Find(n => n.Contains("#") && n.Contains("*")).Replace("#", "").Replace("*","")) ;
- messages.Add($"{name} is {age} years old.");
- }
- Console.WriteLine(string.Join("\n", messages));
- }// END MAIN
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement