邮专飞舞


私信TA

用户名:uq_72676130309

访问量:125

签 名:

等  级
排  名 16012
经  验 771
参赛次数 0
文章发表 3
年  龄 19
在职情况 学生
学  校
专  业

  自我简介:

TA的其他文章

解题思路:0

注意事项:0

参考代码:

#include<stdio.h>

void paixu(int a[],int length){

for(int i=1;i<=length;i++){

for(int j=0;j<length-i;j++){

if(a[j]<a[j+1])

{int temp=a[j];

a[j]=a[j+1];

a[j+1]=temp;

}

}

}

for(int i=0;i<length;i++)

printf("%d ",a[i]);

}

int main(){

int n;

int count=0;

while(count<10){

n=0;

int array[100]={0};

scanf("%d",&n);

for(int i=0;i<n;i++){

scanf("%d",&array[i]);

}

paixu(array,n);

putchar('\n');

count++;

}

return 0;

}


 

0.0分

1 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区