考察一行内的元素输入和获取:
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] str = br.readLine().split(" "); int index = 1; for(String s: str) { if(!s.equals("250")) { index++; } else { System.out.print(index); break; } } } }
原文地址:https://www.cnblogs.com/huangZ-H/p/10087927.html
时间: 2024-10-30 04:50:31