题解 | #截取字符串#
截取字符串
http://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
import java.io.*;
public class Main{
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String str = bf.readLine();
int num = Integer.parseInt(bf.readLine());
StringBuilder sb = new StringBuilder();
for (int i =0; i< num;i++){
sb.append(str.charAt(i));
}
System.out.println(sb);
}
}