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语言代码)浏览:3510 |
简洁的代码浏览:1408 |
C语言训练-求素数问题 (C语言代码)浏览:953 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:1033 |
C二级辅导-进制转换 (C语言代码)浏览:615 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:552 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:640 |
用筛法求之N内的素数。 (C语言代码)浏览:803 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:567 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:560 |