Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language: write a program to achieve bubble sorting, and sort the input n integers in descending order and output them.
C language: write a program to achieve bubble sorting, and sort the input n integers in descending order and output them.
As shown in the figure:

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)

Extended data:

The for loop structure is the most distinctive loop sentence in C language, and it is the most flexible and convenient to use. Its general form is:

For loop body statement. (among them; Can't be omitted)

The expression 1 is an initial value expression, which is used to assign an initial value to the loop variable before the loop starts.

Expression 2 is a loop control logic expression, which controls the conditions of loop execution and determines the number of loops.

Expression 3 is a modified expression of the loop control variable, which makes the for loop tend to end.

The loop body statement is a statement that is repeatedly executed when the loop control condition is established.

However, during the whole process of the for loop, the expression 1 is only evaluated once, while expressions 2 and 3 may be evaluated several times or not at all. The loop body can be executed many times or not at all.

Expression 2 is executed first, then the loop structure, finally Expression 3, and so on.

For loop statement is the most powerful statement in C language, and can even replace other loop statements to some extent.

Baidu encyclopedia -c language