参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int m = scanner.nextInt(); int k = scanner.nextInt(); if(m % 19 != 0) { System.out.println("NO"); return; } int cnt = 0; while(m != 0) { if(m % 10 == 3) cnt++; m /= 10; } if(cnt == k) System.out.println("YES"); else System.out.println("NO"); } }
0.0分
5 人评分
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1282 |
字符串的输入输出处理 (C语言代码)浏览:925 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:530 |
1118(求助_已解决)浏览:329 |
罗列完美数 (C语言代码)浏览:491 |
1035 题解浏览:778 |
C二级辅导-计负均正 (C语言代码)浏览:480 |
时间转换 (C语言代码)浏览:625 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:467 |
简单的事情 (C语言代码)浏览:633 |