Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language arbitrary input 5 numbers, and output in descending order.
C language arbitrary input 5 numbers, and output in descending order.
The following code can be used for calculation:

# Contains? & ltstdio.h & gt

# Contains? & ltstdlib.h & gt

int? Master ()

{

int? a[5];

int? I,j,k;

for(I = 0; I < = 4; i++)

{

scanf("%d ",& ampa[I]);

}

for(I = 0; I < = 4; i++)

{

for(j = 0; j & lt=4; j++)

{

if(a[I]& gt; a[j])

{

k = a[I]; ? a[I]= a[j]; ? a[j]= k;

}

}

}

Printf ("sorting result: \ n");

for(I = 0; I < = 4; i++)

{

printf("%d\t ",a[I]);

}

Return? 0;

}

Extended data:

Data type keyword

Short: decorated int, short integer data, decorated int can be omitted. (Introduction to K & ampr Period)

Long: decorated int, long integer data, decorated int can be omitted. (Introduction to K & ampr Period)

Long long: decorated int, which is a long integer data, and can be omitted. (New content of C99 standard)

Signed: modifies integer data and has a signed data type. (C89 standard has been added)

Unsigned: decorated integer data, unsigned data type. (Introduction to K & ampr Period)

Restrict: used to define and constrain pointers and indicate that pointers are the only and initial way to access data objects. (New content of C99 standard)

Complex type keyword

Structure: Structure declaration. (Introduction to K & ampr Period)

Trade union: consortium statement. (Introduction to K & ampr Period)

Enumeration: Enumeration declaration. (C89 standard has been added)

Typedef: declare type alias. (Introduction to K & ampr Period)

Sizeof: Get the size of a specific type or variable of a specific type. (Introduction to K & ampr Period)

Inline: Inline function is used to replace macro definitions and will be expanded wherever it is called. (New content of C99 standard)

Baidu encyclopedia -c language