求教冒泡for语句改while语句我是新手
const int N = 10;int[] a = new int[N];
int i, j, t;
Random randObj = new Random();
for (i = 0; i < N; i++)
a[i] = randObj.Next(10, 99);
Response.Write("排序前");
for (i = 0; i < N; i++)
Response.Write(" " + a[i].ToString());
for (i=1;i<N ;i++)
for (j=0;j<N-i;j++)
if (a[j] > a[j + 1])
{ t = a[j]; a[j] = a[j + 1]; a[j + 1] = t; }
Response.Write("</br>排序后");
for (i = 0; i < N; i++)
Response.Write(" " + a[i].ToString()); --------------------编程问答-------------------- for(int i=0;i<100;i++)
while(i<100)
{
i++;
} --------------------编程问答-------------------- 楼上正解 --------------------编程问答-------------------- 谢谢...我学会怎么改了 --------------------编程问答-------------------- http://www.cnblogs.com/canflywolf/archive/2010/12/25/1916134.html --------------------编程问答-------------------- 谢谢各位大神 --------------------编程问答-------------------- 除 --------------------编程问答-------------------- 学习了~~~
补充:.NET技术 , C#