参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scanner.nextInt(); int cnt = 0; for(int i = 0; i < n; i++) { int t = scanner.nextInt(); if(t == m) cnt++; } System.out.println(cnt); } }
0.0分
5 人评分
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:516 |
C语言程序设计教程(第三版)课后习题9.8 (Java代码)浏览:1640 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:1420 |
DNA (C语言描述,数据结构)浏览:855 |
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:1341 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:711 |
1009题解浏览:751 |
矩阵乘方 (C语言代码)浏览:1031 |
C二级辅导-温度转换 (C语言代码)浏览:731 |
C二级辅导-等差数列 (C语言代码)浏览:695 |