ALL > Computer and Education > courses > university courses > undergraduate courses > An Overview of Computer Science > zstu-(2019-2020-1) class >
Homework 4_2. 2019529628005 Version 0
👤 Author: by alieusano21gmailcom 2019-10-26 04:08:36
 

#include <stdio.h>
int main(void)
{
int a[]
int n;
int i;
int j;
int t;
n = sizeof(a) / sizeof(a[0]);
for (i=0; i<n-1; ++i)
{
for (j=0; j<n-1-i; ++j)
{
if (a[j] < a[j+1])
{
t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
}
}
for (i=0; i<n; ++i)
{
printf("%d\x20", a[i]);
}

Please login to reply. Login

Reversion History

Loading...
No reversions found.