51单片机:用c语言对数组进行升序排序并且用数码管显示排序后的最大值
答案:1 悬赏:80 手机版
解决时间 2021-02-03 16:07
- 提问者网友:容嬷嬷拿针来
- 2021-02-03 12:11
a[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff}
最佳答案
- 五星知识达人网友:第四晚心情
- 2021-02-03 13:21
#include
#define uchar unsigned char
uchar led[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};
void sort(uchar *a,uchar len)
{
int i=0,j,t;
for(i=0;i
{
for(j=0;j
{
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
}
main()
{
uchar a[]={1,12,2,14,4,6,15,3,9,0,13,7,5,8,11};
sort(a,16);
P0=a[15];
while(1);
}
#define uchar unsigned char
uchar led[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};
void sort(uchar *a,uchar len)
{
int i=0,j,t;
for(i=0;i
for(j=0;j
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
}
main()
{
uchar a[]={1,12,2,14,4,6,15,3,9,0,13,7,5,8,11};
sort(a,16);
P0=a[15];
while(1);
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯