题解 | #小乐乐查找数字#

小乐乐查找数字

http://www.nowcoder.com/practice/4c49a3a1559141f7a080a48c98cca4cb

import java.util.Scanner;
public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for(int i = 0 ; i < n ; i++) {
            array[i] = sc.nextInt();
        }
        int number = sc.nextInt();
        int count = 0;
        for(int i = 0 ; i < n ; i++) {
            if(array[i] == number) {
                count++;
            }
        }
        System.out.println(count);
    }
}
全部评论

相关推荐

秋招不是要开始了吗,我都打算润了,看大家还在找不敢润了
一条从:因为不是人人都像佬一样有实习像我们这种二本仔秋招没有实习也是白忙活
点赞 评论 收藏
分享
06-15 18:44
黄淮学院 Java
Lynn012:如果是居民楼还是算了吧,看着有点野呢
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务