+ 1
Умножене int и double
Решаю задачку, надо в уравнении 0.2*int(к примеру 13000). https://code.sololearn.com/cDkY7Dobaaz5/?ref=app
8 Réponses
+ 3
https://code.sololearn.com/cvDeB6iq6v58/?ref=app
+ 3
TouchiHe I'm not sure what the code was before applying the fix by Sayed🇧🇩🇧🇩 ...
But I figured I would present an alternative of the code using various C# language features you may not have been aware of.
https://code.sololearn.com/cpfBJj3MWNf5/?ref=app
+ 1
I tried to make all the code in double, nothing came of it, if in line 17 it is calculated to int, then the result will be incorrect, since it will replace 0.2 with 0
+ 1
TouchiHe I'm not sure if you're simply making a statement or if you're seeking a response from me to provide an explanation.
If it's the former, then I'm assuming you're still learning many of the basics and I wish you luck on your continued growth. 😉👌
If it's the latter, it wasn't clear as nothing specific was requested.
I'm happy to respond to any questions about specific parts you identify. But, you'll need to point out something specific for me to respond to. Otherwise, I'm not really sure where to begin with a general statement like:
"I didn't understand most of the code at all."
0
Oh, thank you
0
To be honest, I didn't understand most of the code at all.
0
David Carroll it was a statement, but in general, if it's not difficult for you, could you describe everything that happens there in the comments to the code?