[Java] 202104-1

2021/4/11 20:28:11

本文主要是介绍[Java] 202104-1,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

import java.io.*;
import java.util.*;

class Main {

    public Main() throws IOException
    {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        StringTokenizer st = new StringTokenizer(f.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int L = Integer.parseInt(st.nextToken());
        int[] h = new int[L];

        for (int i = 0; i < n; i++)
        {
        	st = new StringTokenizer(f.readLine());
            for (int j = 0; j < m; j++)
            {
                int pixel = Integer.parseInt(st.nextToken());
                h[pixel]++;
            }
        }

        for (int i = 0; i < L; i++)
        {
            out.print(h[i] + " ");
        }
        out.println();
        out.close();
        f.close();
    }
    public static void main(String[] args) throws IOException
    {
        new Main();
    }

}


这篇关于[Java] 202104-1的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程