题解 | #参数解析#
参数解析
https://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input = br.readLine(); boolean skip = true; StringBuilder sb = new StringBuilder(); int count=0; for(int i=0;i<input.length();i++){ char c = input.charAt(i); if(c=='"'){ skip = !skip; continue; } if(c==' ' && skip){ count++; sb.append("\n"); continue; } sb.append(c); } System.out.println(++count); System.out.println(sb); } }