<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
let money = Number(prompt("자판기에 얼마를 넣을 까요?"));
let coffee = 300;
let cup = 0;
while (money > coffee) {
cup++;
money -= coffee;
document.write(`커피${cup}잔, 잔돈${money}원<br>`);
}
</script>
</body>
</html>