![[BOJ] 백준_5585번_거스름돈_C/C++](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FbMW90O%2FbtrrqZnLohc%2FAAAAAAAAAAAAAAAAAAAAAPnUxxaiagq-9FEUAqhxXagZwYNgxDoKn-JL1NoG3s7g%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DIEF37oxrD68YkLwTJ7hITQyl4Wc%253D)
백준 알고리즘2022. 1. 23. 23:40[BOJ] 백준_5585번_거스름돈_C/C++
문제 출처 https://www.acmicpc.net/problem/5585 5585번: 거스름돈 타로는 자주 JOI잡화점에서 물건을 산다. JOI잡화점에는 잔돈으로 500엔, 100엔, 50엔, 10엔, 5엔, 1엔이 충분히 있고, 언제나 거스름돈 개수가 가장 적게 잔돈을 준다. 타로가 JOI잡화점에서 물건을 사 www.acmicpc.net 문제 설명 코드 #include using namespace std; int main() { int n; int num = 0; cin >> n; int charge = 1000 - n; if (charge >= 500) { charge -= 500; num++; } num += charge / 100; if (charge % 100 >= 50) { charge -..