import java.util.Scanner; public class Main { static int nums; static int a; static int b; public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNext()){ a=sc.nextInt(); b=sc.nextInt(); nums=0; dfs("0",1); System.out.println(nums); } } static void dfs(String s,int index){ long n=Long.parseLong(s); if(n!=0&&n>b)return ; if(n>=a&&n<=b)nums++; for (int i = index; i <=9; i++){ dfs(s+i,i); } } }
0.0分
1 人评分
哥德巴赫曾猜测 (C语言代码)浏览:1018 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:277 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)浏览:2081 |
【蟠桃记】 (C语言代码)浏览:1034 |
Hello, world! (C++代码)浏览:1744 |
蛇行矩阵 (C语言代码)浏览:536 |
1012题解浏览:869 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:562 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:489 |
Tom数 (C语言代码)浏览:495 |