1106 冒泡排序文法 图1106 冒泡排序文法 图

  #include <stdio.h>
  
  main() 
  { 
     int i,j,temp; 
      int a[10]; 
  
      for(i=0;i<10;i++) 
          scanf ("%d,",&a[i]); 
 
     for(j=0;j<=9;j++) 
         { for (i=0;i<10-j;i++) 
          if (a[i]>a[i+1]) 
            { temp=a[i]; 
               a[i]=a[i+1]; 
               a[i+1]=temp;} 
         } 
     for(i=1;i<11;i++) 
         printf("%5d,",a[i] ); 
     printf("\n");
  
 }
1106 冒泡排序文法 图

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2022-01-09
  • 2021-06-22
  • 2021-12-25
  • 2021-11-06
猜你喜欢
  • 2021-11-04
  • 2022-02-27
  • 2022-02-12
  • 2021-06-17
  • 2021-05-01
相关资源
相似解决方案