[백준] 14656번 : 조교는 새디스트야!! - Java(자바)

강재원·2022년 10월 1일
0

[코딩테스트] Java

목록 보기
83/200



https://www.acmicpc.net/problem/14656

import java.util.*;
public class Main {
    public static void main(String args[]) {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int count=0;
        for(int i=1;i<=n;i++){
            int a=s.nextInt();
            if(a!=i) count++;
        }
        System.out.print(count);
    }
}
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글