"use strict";
process.stdin.on("end", (_) => {
inputString = inputString.trim().split("\n").map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
/* Please do not modify anything above this line */
class Submarine {
constructor() {
this.isSubmerged = false;
}
/* Write your code here */
}
class WeaponUnit extends Submarine {
/* Write your code here */
}
/* Please do not modify anything below this line */
function main() {
const totalTorpedos = parseInt(readLine());
const torpedosFired = parseInt(readLine());
const weaponUnit1 = new WeaponUnit(totalTorpedos, torpedosFired);
weaponUnit1.dive();
weaponUnit1.fireTorpedos();
weaponUnit1.surface();
}
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});
main();
});
function readLine() {
return inputString[currentLine++];
return input === undefined ? undefined : JSON.parse(input);
}
function calculateFinalValueWithAppreciation(principal, time, apprPercentage) {
let finalValue;
finalValue = principal * (1 + time * appreciation / 100);
return finalValue;
}
function main() {
const principal = readLine();
const time = readLine();
const apprPercentage = readLine();
const finalValue = calculateFinalValueWithAppreciation(principal, time, apprPercentage);
console.log(finalValue);
}
Comments
Leave a comment