新手请教!
昨天照书上打了一段代码 发现5的倍数是找不到的,哪位大虾能告诉我为什么? 以及如何把该数组打印出了来,谢谢!using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Myc11
{
class Program
{
static void Main(string[] args)
{
int x = 200, y = 4;
int[,] myArray = new int[x, y];
for (int i = 0; i < x; i++)
for (int j = 0; j < y; j++)
myArray[i, j] = ++i;
System.Console.WriteLine("请输入你要查找的数: ");
String s = System.Console.ReadLine();
int myNum = int.Parse(s);
for (int i = 0; i < x; i++)
for (int j = 0; j < y; j++)
if (myArray[i, j] == myNum)
goto found;
Console.WriteLine("没有发现数字{0}", myNum);
goto finish;
found:
Console.WriteLine("发现了你要查找的数字" + myNum);
finish: Console.WriteLine("查找完毕!");
}
}
}