📄 排列数(冒泡法2).c
字号:
#include <conio.h> /*此头函数请不要删除 */
#include <stdio.h>
main()
{ int a[10],i,j,t;
printf("Please enter data:\n");
for(i=0;i<=9;i++)
scanf("%d",&a[i]); /*注意%d后面不要有空格*/
for(i=0;i<=8;i++)
for(j=0;j<=8;j++)
if(a[j]>=a[j+1])
{ t=a[j]; a[j]=a[j+1];a[j+1]=t;}
printf("hehe,look at this!\n");
for(i=0;i<=9;i++)
printf("%d ",a[i]);
getch(); /* 此语句请不要删除*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -