[백준] 14470번 : 전자레인지 - Javascript(자바스크립트)

강재원·2022년 9월 19일
0



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

const fs=require('fs')
let ip=fs.readFileSync('/dev/stdin').toString().split('\n')
a=parseInt(ip[0])
b=parseInt(ip[1])
c=parseInt(ip[2])
d=parseInt(ip[3])
e=parseInt(ip[4])
time=0
if(a<0){
    time+=Math.abs(a)*c;
    a=0;
} 
if(a==0) time+=d;
time+=(b-a)*e;
console.log(time);
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글