using System; using System.Text; public class Program { static void Main() { long Key = 0; int[] NumPat = new int[10]; int[] Kotae = new int[10]; int Count =0; int ZeroNum = -1; // 未使用数字を取得 for(long i = 0; i<=9; i++){ int Hit = GetHit(i * 1111111111); if(Hit == 10){ return; }else if(Hit == 0){ ZeroNum = (int)i; } } int HitCount = 0; for(int j =0; j<=9;j++){ if(j==ZeroNum){ continue; } if(ZeroNum == -1){ ResetArray(NumPat,9-j); }else{ ResetArray(NumPat,ZeroNum); } NumPat[0]=j; for(int k =0;k<=9;k++){ HitCount = GetHit(JointArray(NumPat)); if(HitCount == 10){ return; }else if((HitCount == 1 && ZeroNum != -1) || (HitCount == 2 && ZeroNum == -1)){ Kotae[k] = j; } ShiftArray(NumPat); } } if(GetHit(JointArray(Kotae))!=10){ Exception hand = new Exception("お手上げ"); throw hand; } } static int GetHit(long Input){ Console.WriteLine("{0:D10}",Input); return int.Parse(Console.ReadLine().Split(' ')[0]); } static long JointArray(int[] Arr){ long Len = Arr.Length; long Poww = (long)Math.Pow(10, Len-1); long Result = 0; for(var i = 0;i < Len;i++){ Result = Result + Arr[i]*Poww; Poww = Poww / 10; } return Result; } static int[] ResetArray(int[] Arr, int ResetValue){ var tmp = Arr.Length; for(var i = 0;i 0;i--){ Arr[i] = Arr[i-1]; } Arr[0] = Tmp; return Arr; } }