+ 2
¿Necesito resolver todos los casos de prueba a la vez?
Porque cuando hago bien uno me dice que el otro está mal. En caso afirmativo, yo que estoy en JavaScript, como hago para mostrar 2 console log por separado, pues se me junta el resultado. En caso negativo ¿cómo hago para desbloquear los casos de prueba con cadena?
47 Antworten
+ 3
True, I'm stupid xd
+ 1
Hola! sí, necesita escribir un programa a la vez para todos los casos de prueba a la vez. debe ser universal. como un programa de Calculadora que puede producir todas las acciones con números desconocidos para ella
+ 1
retire la variable "pantalones" y use la variable "oldPrice". no es necesario sustituir valores rectos. el programa reemplazará automáticamente los necesarios
+ 1
oldPrice is your input data. the test program inserts the data there automatically. in fact, you only need to finish writing this program. it has already begun. it's like being asked to write a calculator program where you have to provide for two variables whose values you don't initially know
+ 1
Thanks you!! :)
+ 1
Break for dinner teacher
+ 1
//para no abrumarte, hemos escondido el código que ejecuta la entrada
function main() {
var oldPrice = parseInt(readLine(), 10)
// tu código va aquí
var discount = 0.20;
console.log(oldPrice - (0.20 * oldPrice));
}
AAAAAAA I OBTAIN
+ 1
Love you man sorry for the time spent jajajaja
+ 1
I'm sick in bed today, so you've been entertaining me.
0
Mi código.
Ejercicio 7.3 de JavaScript
function main() {
var oldPrice = parseInt(readLine(), 10)
// tu código va aquí
var descuento = 20/100;
var pantalones = 150;
console.log(pantalones - (pantalones * descuento))
var camiseta = 100;
console.log(camiseta - (camiseta * descuento))
var bolso = 1500;
console.log(bolso - (bolso * descuento));
}
El resultado me da =
120
80
1200
(bien)
Pero en un mismo caso de prueba. Por lo que me lo pone mal.
0
I dont understand the oldPrice variable :(
And your second answer neither, what mean rect value?
(You can write in English if you want)
0
in oldPrice the test program will put both the pantalones value for the first time and the camiseta value for the second time
0
rectos - I was trying to say that there is no need to substitute, assign direct values to a variable and formula. the program must be universal for all values
0
Can you give me an example to how should I do it?
0
you should delete the last 4 lines of your code, then use the oldPrice variable instead of the pantalones variable
0
The parseInt() function takes a string as an argument and returns an integer according to the specified base of the number system.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
0
pantalones, camiseta, bolso - all of these variables you created are replaced by the oldPrice variable. the following values are written to this variable in turn: 150, 100, 1500
hint: if you are solving this kind of task, you should definitely use the already created variables in your code
0
did you succeed or not?
0
Negative. And console.log? I need to use it?
Just need an example and i think i could do it.
0
Yes