本文主要是介绍Convert.ToInt32字符串转为整型,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
using System;namespace ConsoleApplication2
{class Program{static void Main(string[] args){Console.WriteLine("请输入第一个数字:");string firstNO = Console.ReadLine();int firstNOInt = Convert.ToInt32(firstNO);Console.WriteLine("请输入第二个数字:");string secondNO = Console.ReadLine();int secondNOInt = Convert.ToInt32(secondNO);Console.WriteLine("{0} + {1} = {2}" , firstNOInt, secondNOInt, firstNOInt + secondNOInt);Console.ReadKey();}}
}
这篇关于Convert.ToInt32字符串转为整型的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!