--- C# 7.3 ---
using System;
using System.Collections.Generic;
using System.Linq;
namespace CSLear
{
class Program
static void Main(string[] args)
string[] RawString = Console.ReadLine().Split(' ', ',' , '.');
int Shortest = RawString.Select(s => s.Length).Min();
for (int index = 0; index < RawString.Count(); index++)
ref string selected = ref RawString[index];
if (selected.Length == Shortest && selected != "")
selected = selected.Insert(0, "*");
}
Console.WriteLine(string.Join(" ", RawString));
Console.ReadKey();
--- C# 7.3 ---
using System;
using System.Collections.Generic;
using System.Linq;
namespace CSLear
{
class Program
{
static void Main(string[] args)
{
string[] RawString = Console.ReadLine().Split(' ', ',' , '.');
int Shortest = RawString.Select(s => s.Length).Min();
for (int index = 0; index < RawString.Count(); index++)
{
ref string selected = ref RawString[index];
if (selected.Length == Shortest && selected != "")
{
selected = selected.Insert(0, "*");
}
}
Console.WriteLine(string.Join(" ", RawString));
Console.ReadKey();
}
}
}