题解 | #截取字符串#
截取字符串
https://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
import java.util.*; public class Main { public static void main(String[] args) { Scanner fzhinput = new Scanner(System.in); String zfc = fzhinput.nextLine(); StringBuilder stack = new StringBuilder(); int jqcd = fzhinput.nextInt(); for(int i =0;i<jqcd;i++){ stack.append(zfc.charAt(i)); } System.out.println(stack.toString()); } }