当我按CTRL+ALT+SHIFT+]意大利语键盘上的键盘快捷键添加一个封闭的大括号时,Visual Studio会选择我的代码块而不是打印它.我已经尝试重置Visual Studio上的键盘映射但无济于事.
其他程序没有问题.我该如何解决这个问题?
你可以从标题中读到我试图在数组中存储两个数字之间的所有数字.例如,将数字存储在数组中的21到43之间(22,23,24,25,26,27,28,29 ...).
这是代码,我不知道为什么,但它只打印较高的数字减1.
class Program
{
static void Main(string[] args)
{
int higher = 43;
int lower = 21;
int[] numbers = new int[22]; //the numbers between 21 and 43 are 22
for (int i = lower; i < higher;i++)
{
for (int a = 0; a < 22; a++)
{
numbers[a] = i;
}
}
for (int c = 0; c < 22; c++)
{
Console.WriteLine(numbers[c]);
}
Console.ReadLine();
}
}
Run Code Online (Sandbox Code Playgroud)