C --- string 简介1、构造函数2、迭代器(主流的遍历方式)2.1字符串经典遍历和修改的方式2.2使用迭代器遍历和修改字符串2.3使用范围for遍历对象(C11支持的新特性) 3、常见,常用方法或重载3.1查询大小和容量管理3.2增3.…
import java.util.*;public class Main {public static void main(String[] args) {Scanner sc new Scanner(System.in);int l sc.nextInt();int n sc.nextInt();// 没有士兵的情况if (n 0) {System.out.println("0 0");return;}// 都初始化为最小值,…