The "C language" writes a bubbling sort, sorting an array of shaping.

Source: Internet
Author: User

#define  _CRT_SECURE_NO_WARNINGS 1#include <stdio.h> #include  <stdlib.h>int  main () { int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8 ,  9, 10 }; int len = sizeof (arr)/sizeof (arr[0]);  int i =  0; int j = 0; for  (;  i < len - 1; i++)  {  for  (j=0; j < len - i-1; j++)   {    if  (arr[j] < arr[j + 1])    {    int  tmp = arr[j];    arr[j] = arr[j + 1];     arr[j + 1] = tmp;   }  } } for  (i  = 0; i < len; i++)  {  printf ("%d ",  arr[i]);  }  system ("pause");  return 0;} 

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/75/D3/wKiom1ZDEO7C6r5gAADvO-0IODs838.jpg "title=" r33$ 5gnan%]sebo8fg7}ybd.jpg "alt=" Wkiom1zdeo7c6r5gaadvo-0iods838.jpg "/>

The "C language" writes a bubbling sort, sorting an array of shaping.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.