정렬하기

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> int main(){ int N,n; int i,j; int key; int jj; int array[5]; scanf("%d",&N); for(i=0; i<N; i++){ scanf("%d",&n); array[i]=n; } for(i=1; i<N; i++){ key=array[i]; for(j=i; j>0; j--){ if(array[j]<array[j-1]){ jj=array[j]; array[j]=array[j-1]; array[j-1]=jj; } } for(j=0; j<N; j++){ printf("%d",array[j]); }printf("\n"); } for(i=0; i<N; i++){ printf("%d\n",array[i]); } }
Editor Settings
Theme
Key bindings
Full width
Lines