package no304; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] s = new char[10]; Arrays.fill(s, '0'); for(int i=0;i<10;i++) { int max = -1; int maxj = 0; for(int j=0;j<10;j++) { s[i] = (char) ('0' + j); System.out.println(String.valueOf(s)); int match = sc.nextInt(); sc.next(); if (match > max) { max = match; maxj = j; } if (match == 10) { return; } } s[i] = (char) ('0' + maxj); } } }