Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function time15 (input)
- {
- let chas = Number(input.shift());
- let minuti = Number(input.shift());
- if ( minuti <= 44)
- {
- let minuti15= minuti +15;
- console.log(`${chas}:${minuti15}`)
- }
- else{
- let chasmin= chas*60;
- let obshtomin = chasmin+ minuti+15;
- novchas = Math.floor(obshtomin/60);
- novmin = (obshtomin % 60 );
- if (novmin<10)
- {
- if (novchas>=24){
- novchas = 0
- }
- console.log(`${novchas}:0${novmin}`)
- }
- else{
- if (novchas>=24){
- novchas = 0
- }
- console.log(`${novchas}:${novmin}`);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment