标签:HERE out 处理 code ret port class i++ 小米
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String line; while (scan.hasNextLine()) { line = scan.nextLine(); // please write your code here System.out.println(Main.solution(line)); } } private static String solution(String line){ String [] str=line.split(" ");///以空格分离的两个字符串4,5,6,7,0,1,2 6 String [] str1=str[0].split(",");///以逗号分离的字符串4,5,6,7,0,1,2 String goal = str[1]; for(int i=0;i<str1.length;i++) if(str1[i].equals(goal)) return String.valueOf(i); return String.valueOf(-1); } }
标签:HERE out 处理 code ret port class i++ 小米
原文地址:https://www.cnblogs.com/wszhu/p/12799189.html