IT 정보/알고리즘(백준, BOJ)

[백준-BOJ] 5565

Dalyoung 2021. 3. 2. 22:34
728x90

www.acmicpc.net/problem/5565

 

5565번: 영수증

첫째 줄에 10권의 총 가격이 주어진다. 둘째 줄부터 9개 줄에는 가격을 읽을 수 있는 책 9권의 가격이 주어진다. 책의 가격은 10,000이하인 양의 정수이다.

www.acmicpc.net

#include "stdio.h"


int main()
{
	int total, price;
	scanf("%d", &total);
	for (int i = 0; i < 9; i++) {
		scanf("%d", &price);
		total -= price;
	}
	printf("%d\n", total);
    return 0;
}
728x90
반응형

'IT 정보 > 알고리즘(백준, BOJ)' 카테고리의 다른 글

[백준-BOJ] 6359  (0) 2021.04.07
[백준-BOJ] 5585  (0) 2021.04.07
[백준-BOJ] 5557  (0) 2021.03.02
[백준-BOJ] 5543  (0) 2021.03.02
[백준-BOJ] 5373  (0) 2021.03.02