Home > Net >  C # console input is 3600 string must first convert so?
C # console input is 3600 string must first convert so?

Time:09-21


From the keyboard in all string? Such as knock "" 3600", "but it is a type string

CodePudding user response:

What is you see readline returns

CodePudding user response:

Through the ReadLine returns the string, can pass int. J the Parse method such as transformation

CodePudding user response:

Readline return value is a string

CodePudding user response:

Int I=int. Parse (Console. ReadLine ());

CodePudding user response:

There is no way to allow the user to input a number directly, because if the user input cannot judge,
Of course, also can write a method to force the user to input a number, but it actually involves some logic, Microsoft won't be able to deal with this kind of thing, it can only be leaving you personally to deal with,
  •  Tags:  
  • C#
  • Related