求解!
vs2015吧
全部回复
仅看楼主
level 5
瘕然 楼主
这那里错了,为什么输入十个数按回车就没反应了
2015年12月23日 04点12分 1
level 5
瘕然 楼主
下一步就不走了(>﹏<)
2015年12月23日 04点12分 2
level 1
这个算法是没错的,可能是编写有点问题的吧,最好检查一下语法结构。
下面是用C#来表达的
class Program
{
static void Main(string[] args)
{
int i, j, x;
int[] a;
a = new int[10];
Console.WriteLine("输入十个自然数");
for (i = 0; i < 10; i++)
{
Console.WriteLine("第" + i + "个:");
a[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine();
for (j = 0; j < 9; j++)
for (i = 0; i < 9 - j; i++)
if (a[i] > a[i + 1])
{
x = a[i];
a[i] = a[i + 1];
a[i + 1] = x;
}
for (i = 0; i < 10; i++)
{
Console.WriteLine(a[i]);
}
Console.ReadLine();
}
}
2015年12月23日 08点12分 3
哦哦,谢谢
2015年12月23日 11点12分
level 1
你沒學過 單步調試 嗎
2015年12月23日 15点12分 4
level 10
循环这么多,吃饱了。。
2015年12月23日 20点12分 6
不多啊→_→
2016年01月04日 08点01分
1