For example,
int num;
num = Convert.ToInt32(Console.ReadLine());
The function Convert.ToInt32() converts the data entered by the user to int data type, because Console.ReadLine() accepts the data in string format.
C#------Accepting Values from User
原文:https://www.cnblogs.com/ShadowDomain/p/11442070.html