编程完成从键盘上接受俩个字符串,将第二个字符串插入到第一个字符串的指定位置上,并显示合并后的串
来源:百度知道 编辑:UC知道 时间:2024/05/25 10:02:04
利用汇编语言编写 汇编语言啊 楼下的貌似不是吧 谢谢楼下俩位 可是必须用汇编啊 在帮帮忙啊
static void Main(string[] args)
{
string strValue1 = "";
string strValue2 = "";
string strShowValue = "";
string strIndex = "" ;
int nIndex;
Console.WriteLine("请输入第一个字符串(回车确定):");
strValue1= Console.ReadLine();
Console.WriteLine("请输入第二个字符串(回车确定):");
strValue2 = Console.ReadLine();
Console.WriteLine("请输入要插入到第一个字符串的位置(从0到{0},回车确定)",strValue1.Length.ToString());
strIndex = Console.ReadLine();
while (!int.TryParse(strIndex, out nIndex))
{
Console.WriteLine("输入错误,请输入要插入到第一个字符串的位置(从0到{0},回车确定)", strValue1.Length.ToString());
strIndex = Console.ReadLine();
}
nIndex = Convert.ToInt32(strIndex);
if (nIndex > strValue1.Length)
{
nIndex = strValue1.Length;
}
if (nIndex < 0)
{