2
1 C
2
3
4
5
Main()
{
int a;
a=5;
printf(“a=%d”,a);
}
int a
Main()
{
char a;
a=?f?;
printf(“a=%c”,a);
}
aC
1 C
C
1.
2.
3.9
4.
C
[Return]
2
2.1
1.
2.
1
12345
2
15.8?
3
f?,?h?
4
4
∏3.14159…
#define PI 3.14 /*PI3.14*/
main() /**/
{ float r,l,s; /**/
r=4; /*r*/
l=2*PI*r /*2∏rl*/
s=PI*r^2; /*∏r2s*/
printf(“Result,%f,%f \n”,l,s); /**/
}
a? char aa;
9 int i=9i;
2.3.2
1.
int a; a
2.
1
2
.
1
2
student_namestudent_number
TC V2.0
3C
C
C32
1 12 char,double,enum,float,int,long,short,
signed,struct,union,unsigned,void
212break,case,continue,default,do,else,for,
goto,if,return,switch,while
34auto,extern,register,static
44const,sizeof,typedef,volatile
CtotalTOTALToTaLtOtAl

A A_1_2
B M.john
C int
D _rt
E if
──
name/xmsex/xbage/nlsalary/gz
4.
1
[ ] [,2…… ];
int a; int a,b,c;
2
[] [=][,2[=2]…… ];
float radius=2.5,length,area;
[Return]
A int a,b,c; a=123; b=c=456;
B int a=123,b=c=456;
C int a=123,b=456,c=456;
Main()
{
int a;
a=999999999;
printf(“a=%d”,a);
}
2.4
2.4.1
1.
1int
2short [int]
3long [int]
4unsigned [int]unsigned shortunsigned long
2.
P43 31
3.
1.,
int a,b,c;
2.
short int short a,b,c;
3.
long int long a,b,c;
4.
unsigned a,b,c;
unsigned short a,b,c;
unsigned long a,b,c;
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 =32767
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 =65535
2.4.2
.
11036
3+x
0x36
0235,0146 012.
0235=2 643 8515710
01461 644 8610210
012(1 821010
2
.
1162int
2 Ll ---123l315
.
----intlong int ----long int
unsigned unsigned
[Return]
2.5
2.5.1
1float
2double15~16
(3) long double
float x,y;
double z;
long double t;
2.5.2
.
13.149.8
2<>Ee<>3.0+5
ee32.1e3.512ee
e
2.135E103.066e9
[Return]
2.6
2.6.1
1.
A?
2.
\,
:
\n
\t
\v
\b
\r
\f
\\
\'
\ddd
\xxh
()
\
()
138
1216
,\ ASCII
\ 101 –– A
\ x 41–– A
[2.1]
main()
{
printf(“\x4F\x4B\x21\n”); /* printf(“OK!\n”); */
printf(“\x15 \xAB\n”);
}
2.6.2
char1
1.
ASCII
char ch1,ch2; /*ch1ch2*/
ch1=?a?; ch2=?b?; /* */
2.
ASCII── 2-4
1
[2.2]
[]
:
97a
2ASCII
[2.3]
main()
{
char x1,x2;
x1=?a?; x2=?b?;
x1=x1-32; x2=x2-32;
printf(“%c %c”,x1,x2);
}
2.6.3
1.
0
How do you do.” Good morning.” 1413
1C:\msdos\v6.22 → "C,\\msdos\\v6.22"
2I say:"Goodbye!" → "I say,\"Goodbye!\"“
2.
C \0?
\0?
CHINA”
'\0'
C H I N A \0
'A'"A"
1
210
3ASCII \0?
[Return]