日期:2014-05-20 浏览次数:20813 次
import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); sc.useDelimiter(","); while (sc.hasNext()) { System.out.println(sc.next()); } sc.close(); } }
Scanner sc = new Scanner(System.in); String s = sc.nextLine(); Scanner Scanner = new Scanner(s); Scanner.useDelimiter(","); while(Scanner.hasNext()) { System.out.println(Scanner.next()); }