-3
public class NIS {
public static void insertSort(int[] A)
{
for(int i = 1; i < A.length; i++)
{
int value = A[i];
int j = i - 1;
while(j >= 0 && A[j] > value)
{
A[j + 1] = A[j];
j = j - 1;
}
A[j + 1] = value;
}
}
public static void main(String[] args) {
int a[]={20,10,2,100,1};
insertSort(a);
for (int i=0 ; i <a.length ; i++)
{
System.out.println(" "+a[i]);
}
// in this code there are many problems if anyone of you can help me so plz debugg this code.
}
}
このように実行できます:1) 'javac -cp。 NIS.java' 2) 'java NIS' –
質問をする前に、このURLを見てください:http://stackoverflow.com/help/how-to-ask –
ようこそ! "デバッグの助けを求める質問(「なぜこのコードは動作しないのですか?」)には、目的の動作、特定の問題またはエラー、および質問自体にそれを再現するのに必要な最短コードが含まれていなければなりません。明確な問題文がない質問は、他の読者にとっては有用ではありません」と引用した。[ここで私はどのような話題を聞くことができますか?](http://stackoverflow.com/help/on-topic) –