using System; using System.Collections.Generic; using System.Linq; public struct KusaItem{ public string word; public int kusaCnt; public KusaItem(string word,int kusaCnt){ this.word=word; this.kusaCnt=kusaCnt; } } class Kusa{ static void Main(){ char[] chars = Console.ReadLine().ToCharArray(); List list = new List(); int cnt=0; string str=""; for(int i=0;i i && chars[i+1] != 'w') || chars.Length-1 <= i){ list.Add(new KusaItem(str,cnt)); str=""; } } } int max=0; //linqでやりたかった(´・ω・`) foreach(var item in list) if((max < item.kusaCnt) && !String.IsNullOrWhiteSpace(item.word)) max = item.kusaCnt; foreach(KusaItem item in list){ if(item.kusaCnt == max) Console.WriteLine(item.word); } } }