백준 #5565번 영수증

jhj·2024년 6월 1일

백준 JAVA

목록 보기
509/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int total = sc.nextInt();
		int[] book = new int[9];
		
		int bookT = 0;
		for(int i = 0; i < book.length; i++) {
			book[i] = sc.nextInt();
			bookT += book[i];
		}
		
		System.out.println(total - bookT);
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글