+ 1

Умножене int и double

Решаю задачку, надо в уравнении 0.2*int(к примеру 13000). https://code.sololearn.com/cDkY7Dobaaz5/?ref=app

27th Apr 2021, 9:10 PM
TouchiHe
TouchiHe - avatar
8 Réponses
+ 3
https://code.sololearn.com/cvDeB6iq6v58/?ref=app
27th Apr 2021, 9:52 PM
TOLUENE
TOLUENE - avatar
+ 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
29th Apr 2021, 8:21 AM
David Carroll
David Carroll - avatar
+ 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
27th Apr 2021, 9:24 PM
TouchiHe
TouchiHe - avatar
+ 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."
30th Apr 2021, 2:28 PM
David Carroll
David Carroll - avatar
0
Oh, thank you
27th Apr 2021, 11:13 PM
TouchiHe
TouchiHe - avatar
0
To be honest, I didn't understand most of the code at all.
29th Apr 2021, 7:53 PM
TouchiHe
TouchiHe - avatar
29th Apr 2021, 7:53 PM
TouchiHe
TouchiHe - avatar
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?
1st May 2021, 9:07 AM
TouchiHe
TouchiHe - avatar