Current location - Training Enrollment Network - Mathematics courses - Mathematical language input
Mathematical language input
# include & ltstdio.h & gt

void main()

{

int a,b,c,t;

Printf ("Please enter three integers: ABC \ n");

Scanf("%d%d%d ",& i, & ampb & amp;; c);

If (a>b)

{

t = a;

a = b;

b = t;

}

If (a>c)

{

t = a;

a = c;

c = t;

}

If (b>c)

{

t = b;

b = c;

c = t;

}

Printf ("The three integers after sorting are: %d, %d, %d\n", a, b, c);

}

language standard

At first, there was no official standard for C language. 1978 by at&t company (at&: T) Bell Laboratories officially released the C language. Brian Kernighan and Dennis Ritchie published a book called C Programming Language. This book is called K&, written by C language developers. For many years, R has been regarded as an informal standard specification of C language. People call this version of C language K &;; People's Republic of China (PRC). [3]?

K & ampR C mainly introduces the following features:

structure type

Long integer

Unsigned int type

Change the operators =+and =-to+= and-=. Because =+and =-will make the compiler not know whether the user wants to process i =-10 or i =- 10, which will cause confusion in processing.

Even years after the ANSI C standard was put forward, K&; R C is still the most accurate requirement of many compilers, and many old compilers still run K &;; Standard for reinforced concrete.

From 1970 to 1980s, C language was widely used, and many different versions of C language were derived from mainframes to minicomputers.

1983, American National Standards Institute (ANSI) established a committee X3J 1 1 to formulate the C language standard. ? [4]?

1989, American National Standards Institute (ANSI) adopted the C language standard, which is called ANSI X3. 159- 1989 "Programming Language C". Because this standard is adopted by 1989, it is generally called C89 standard. Some people call it ANSI C for short, because this standard is issued by American National Standards Institute (ANSI).

1990, the international organization for standardization (ISO) and the International Electrotechnical Commission (IEC) set the C89 standard as the international standard of C language, and named it ISO/IEC 9899: 1990- Programming Language -C? [5]。 Because this standard was issued by 1990, some people call it C90 standard for short. But most people still call it C89 standard, because it is completely equivalent to ANSI C89 standard.

1994, the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) issued a revised version of the C89 standard, which was called ISO/IEC 9899:1990/COR1:1994 [6], and some people referred to it as C94 standard for short.

1995, the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) released the revised version of the C89 standard again, named ISO/IEC 9899:1990/AMD1:1995-c integrity? [7], some people call it C95 standard for short.

C99 standard

1999 1 10. In October, the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) issued a new standard for C language, named ISO/IEC 9899: 1999- Programming Language -C? [8], referred to as C99 standard. This is the second official standard of C language.

C99 includes the following functions:

Added restrictions on the compiler, such as requiring the source program to support at least 4095 bytes per line, requiring variable names and function names to support 63 bytes (requiring extern to support 3 1).

The pretreatment function is enhanced. For example:

Macro supports variable parameter # definecomacro(...)_ _ va _ args _ _

When you use a macro, you are allowed to omit parameters, and the omitted parameters will expand into empty strings.

Support single-line comments starting with//(this feature has actually been supported by many compilers of C89)

Added new keywords restrict, inline, _ complex, _ imaginary, _ bool.

Supports long long, long double _ complex, float _ complex and other types.

Support arrays of indefinite length, that is, the array length can be determined at runtime, such as using variables as the array length. Use the form of int a[var] when declaring. However, considering the efficiency and implementation, indefinite length arrays cannot be used globally, nor can they be used in struct and union.

The variable declaration does not have to be placed at the beginning of the statement block, and the for statement advocates writing for(int I = 0;; I< 100; ++i), that is, I is only valid inside a for statement block.

It is allowed to construct anonymous structures in the form of (type_name){xx, xx, xx} constructor similar to C++.

Compound text: when initializing the structure, it is allowed to assign values to specific elements in the form of:

Structural test {int a[3], b; } foo[] = { [0]。 a = { 1},[ 1]。 a = 2 };

Structural test {int a, b, c, d; } foo = {。 a = 1,。 c = 3,4,.b = 5 }; //3,4 is an assignment. c,。 d.

Use \u to support unicode characters in formatted strings.

Support floating-point description of 16.

printf? scanf? The formatted string of adds support for the long long int type.

The internal data description of floating-point numbers supports the new standard and can be specified by using the #pragma compiler instruction.

The current function name is obtained by adding __func__ in addition to the existing file in line _ _ _ _.

Allows the compiler to simplify non-constant expressions.

The definition of/%when dealing with negative numbers is modified, which can give clear results, such as -22/7 = -3, -22% 7 =-1, -22/7 =-4, -22% 7 = 6 in C89. In C99, it is -22/7 = -3, -22% 7 =-1, and there is only one result.

Canceled the provision that the default return type of the function is int.

Allows the last array defined by struct to be written as [] (flexible array member) without specifying its length.

Const const int i will be regarded as const int i.

Some standard header files have been added and modified, such as

I/O supports wide characters and long integers.

GCC and other commercial compilers support most features of C99.