帮我看看这个,我的目的是在窗口输入listarg 9 9后打印出九九乘法表。

大可山人
博客专家认证
2003-08-06 01:59:40
------文件名:listarg.cs-----------
using System;
class listArg
{
public static void Main(string[] args)
{
int i=0;
int j=0;
if(args.Length==2)
{
// i=Convert.ToInt32(args[0]);
// j=Convert.ToInt32(args[1]);
i=int.Parse(args[0]);
j=int.Parse(args[1]);
for(int m=1;m<=i;m++)
{
for(int n=1;n<=j;n++)
Console.WriteLine("{0}*{1}={2}\t",m,n,m*n);
}
}
}
}

用csc listarg.cs编译后执行listarg 9 9时跳回VS.net中,不知是何原因?
谢谢!
...全文
83 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
大可山人 2003-08-06
  • 打赏
  • 举报
回复
可以了。

using System;
using System.IO;
class listArg
{
public static void Main(string[] args)
{
int i=0;
int j=0;
if(args.Length==2)
{
// i=Convert.ToInt32(args[0]);
// j=Convert.ToInt32(args[1]);
i=int.Parse(args[0]);
j=int.Parse(args[1]);
for(int m=1;m<=i;m++)
{
for(int n=1;n<=j;n++)
{
Console.Write("{0}×{1}={2}\t",m,n,m*n);
if(n==j)
Console.Write("\r\n");
}
}
}
}
}
csdn_bob 2003-08-06
  • 打赏
  • 举报
回复
不会呀,我把你的code,paste到一个notepad下运行,正确!

110,567

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧