알고리즘 풀이/백준

[백준][Java] 10797번 10부제

배게 2018. 5. 10. 08:32
728x90

자동차 뒷자리 수가

날짜와 일치할 경우 res값 counting


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int T = sc.nextInt();
		int res=0;
		for(int i=0; i<5; i++) {
			if(sc.nextInt()==T) res++;
		}
		System.out.println(res);
	}
	
}