+ 1

Pls help with error in c# can't convert string to int

I got an error 'can't convert string to int' but string is number. What to do? Help pls. https://sololearn.com/compiler-playground/cs4Q56FCueFX/?ref=app My code.

17th Mar 2024, 12:07 PM
KotaroTOP
KotaroTOP - avatar
3 Respostas
+ 3
I agree with NB‎. output was declared as int, but in line 48 you are assigning a string to it. yes, directly print the result. No need for the ouput variable. also, you have mixed up and duplicated cases.
17th Mar 2024, 1:10 PM
Bob_Li
Bob_Li - avatar
+ 3
NB, Bob_Li thank you very much :)
17th Mar 2024, 5:53 PM
KotaroTOP
KotaroTOP - avatar