欲想解决此题,首先第一步,我们需要把L-R这些书数都转变成字符串,接下来我们可以遍历每一个字符串,传出的字符,我们用if语句来判断是否等于字符2,若相等则计数器加一,直到全部遍历完得出最终的次数。 import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int y=sc.nextInt(); int n=sc.nextInt(); int x=2; i...