using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; string correct = "CORRECT (maybe)"; string wrong = "WRONG!"; string inpt = string.Empty; do { inpt = Reader.ReadLine(); if(inpt == null) { continue; } int pos = inpt.IndexOf(" "); if(pos < 0) { Console.WriteLine(wrong); continue; } string name = inpt.Substring(0,pos); string dialog = inpt.Substring(pos + 1); string[] names = new string[] {"digi", "petit", "gema", "piyo"}; string[] gobis = new string[] {"nyo", "nyu", "gema", "pyo"}; bool isCorrect = false; if(name.Equals("rabi")) { foreach (char c in dialog) { if(!this.IsKigou(c)) { isCorrect = true; } } } else { int idx = -1; for(int i=0; i 3) { Console.WriteLine(wrong); continue; } if(!this.ContainsNotKigou(last)) { isCorrect = true; } } if(isCorrect) { Console.WriteLine(correct); } else { Console.WriteLine(wrong); } } while (inpt != null); } private bool ContainsNotKigou(String str) { foreach (char item in str) { if(!IsKigou(item)) { return true; } } return false; } private bool IsKigou(char c) { if(c >= 'a' && c <= 'z') { return false; } else if(c >= 'A' && c <= 'Z') { return false; } else if(c >= '0' && c <= '9') { return false; } return true; } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" digi correct-da-nyo digi KOREMO CORRECT DA NYO digi KoReDeMo Correct NanDa Nyo!! petit putit ha digi ja nai nyo "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } } static void Main() { Program prg = new Program(); prg.Proc(); } }