zoukankan      html  css  js  c++  java
  • codeinsertSort

    #include "stdio.h"
    #define N 7
    int main(void)
    {
      char a[N]="824936";
      int j,i;
      int key;
      for(j=2;j<N-1;j++){
        key=a[j];
        i=j-1;
        while(i>0 && key<a[i]){
          a[i+1]=a[i];   /*a[i+1]=a[j]*/
          --i;
        }
        a[i+1]=key;
      }
      while(--j>-1){
        printf("%c", a[N-1-j]);
      }
      getch();
      return 0;
    }
    
  • 相关阅读:
    HDU 1978 How many ways
    hdu 1966 Pie
    hdu 1966 Pie
    HDU 1896 Stones
    HDU 1896 Stones
    hdu 1278 逃离迷宫
    hdu 1278 逃离迷宫
    HDU 2548 A strange lift
    HDU 2548 A strange lift
    PHP 错误与异常 笔记与总结(10)错误处理器测试
  • 原文地址:https://www.cnblogs.com/qinghao/p/1748908.html
Copyright © 2011-2022 走看看