467
|
1 int printf(const char *format, ...);
|
170
|
2
|
|
3 short gj;
|
|
4 short gi;
|
|
5
|
|
6 short a[100];
|
|
7 unsigned short b[100];
|
|
8 unsigned char c[100];
|
|
9
|
278
|
10 short data[] = {10,20,-40,-50};
|
|
11 unsigned short udata[] = {10,20,-40,-50};
|
170
|
12
|
|
13 short f(short i,unsigned short j,unsigned short k,short m,short a);
|
|
14 unsigned
|
|
15 short g(short i,unsigned short j,unsigned short k,short m,short a);
|
|
16
|
|
17 main()
|
|
18 {
|
|
19 int ii;
|
|
20 short i,k,*p;
|
|
21 unsigned short j,m,*up;
|
|
22 unsigned char g0,h0;
|
|
23 char g1,h1;
|
|
24 unsigned short sg0,sh0;
|
|
25 short sg1,sh1;
|
|
26 unsigned char *pg0,*ph0;
|
|
27 char *pg1,*ph1;
|
|
28 unsigned short *psg0,*psh0;
|
|
29 short *psg1,*psh1;
|
|
30
|
|
31
|
|
32 i = -3;
|
|
33 j = 3;
|
|
34 k = 44;
|
|
35 k = i*j+3+k;
|
|
36 m = i*j-7+k;
|
427
|
37 printf("#0035:%d %d %d\n",i,k,m);
|
170
|
38
|
|
39 g0 = 123;
|
|
40 g0++; --g0;
|
|
41 ++g0; g0--;
|
427
|
42 printf("#0040:g0=%d\n",g0);
|
170
|
43 g1 = -123;
|
|
44 g1++; --g1;
|
|
45 ++g1; g1--;
|
427
|
46 printf("#0044:g1=%d\n",g1);
|
170
|
47
|
|
48 sg0 = 123;
|
|
49 sg0++; --sg0;
|
|
50 ++sg0; sg0--;
|
427
|
51 printf("#0049:sg0=%d\n",sg0);
|
170
|
52 sg1 = -123;
|
|
53 sg1++; --sg1;
|
|
54 ++sg1; sg1--;
|
427
|
55 printf("#0053:sg1=%d\n",sg1);
|
170
|
56
|
|
57 pg0 = &g0;
|
|
58 ph0 = &h0;
|
|
59 *pg0 = 123;
|
|
60 //*pg0++; *--pg0;
|
|
61 //*++pg0; *g0--;
|
427
|
62 printf("#0060:g0=%d\n",*pg0);
|
170
|
63 pg1 = &g1;
|
|
64 ph1 = &h1;
|
|
65 *pg1 = -123;
|
|
66 //*pg1++; --*pg1;
|
|
67 //++*pg1; *pg1--;
|
427
|
68 printf("#0066:g1=%d\n",*pg1);
|
170
|
69
|
|
70 psg0 = &sg0;
|
|
71 psh0 = &sh0;
|
|
72 *psg0 = 123;
|
|
73 //*sg0++; *--sg0;
|
|
74 //*++sg0; *sg0--;
|
427
|
75 printf("#0073:sg0=%d\n",*psg0);
|
170
|
76 psg1 = &sg1;
|
|
77 psh1 = &sh1;
|
|
78 *psg1 = -123;
|
|
79 //*sg1++; *--sg1;
|
|
80 //*++sg1; *sg1--;
|
427
|
81 printf("#0079:sg1=%d\n",*psg1);
|
170
|
82
|
|
83
|
|
84 h0 = g0 - 20;
|
|
85 c[33] = g0;
|
|
86
|
427
|
87 if (i==j) { printf("#0085:i==j\n"); } else { printf("i!=j\n"); }
|
170
|
88
|
|
89 a[33] = i;
|
|
90 b[33] = 105;
|
427
|
91 printf("#0089:i=%d\n",i);
|
|
92 printf("#0090:j=%d\n",j);
|
170
|
93 i++; --i;
|
|
94 j++; --j;
|
427
|
95 printf("#0093:i=%d\n",i);
|
|
96 printf("#0094:j=%d\n",j);
|
170
|
97 gi = 3333;
|
|
98 gj = 6666;
|
|
99 gi++; --gi;
|
|
100 gj++; --gj;
|
427
|
101 printf("#0099:gi=%d\n",gi);
|
|
102 printf("#0100:gj=%d\n",gj);
|
170
|
103
|
427
|
104 printf("#0102:k=%d\n",k);
|
|
105 printf("#0103:m=%d\n",m);
|
|
106 printf("#0104:a[33]=%d\n",a[33]);
|
|
107 printf("#0105:b[33]=%d\n",b[33]);
|
|
108 printf("#0106:a[33]=%d\n",++a[33]);
|
|
109 printf("#0107:b[33]=%d\n",b[33]--);
|
170
|
110
|
427
|
111 printf("#0109:g0=%d\n",g0);
|
|
112 printf("#0110:h0=%d\n",h0);
|
|
113 printf("#0111:c[33]=%d\n",c[33]);
|
170
|
114
|
|
115 p = data;
|
427
|
116 printf("#0114:*p++ = %d\n",*p++);
|
|
117 printf("#0115:*++p = %d\n",*++p);
|
170
|
118 *p++ = -343;
|
427
|
119 printf("#0117:*p-- = %d\n",*p--);
|
|
120 printf("#0118:*--p = %d\n",*--p);
|
170
|
121 up = udata;
|
427
|
122 printf("#0120:*up-- = %d\n",*up--);
|
|
123 printf("#0121:*--up = %d\n",*--up);
|
170
|
124 *up++ = 65530;
|
427
|
125 printf("#0123:*up-- = %d\n",*up--);
|
|
126 printf("#0124:*--up = %d\n",*--up);
|
170
|
127
|
|
128
|
|
129 ii = f(i,j,k,m,a[33]);
|
427
|
130 printf("#0128:f()=%d\n",ii);
|
170
|
131 ii = g(i,j,k,m,a[33]);
|
427
|
132 printf("#0130:f()=%d\n",ii);
|
172
|
133 return 0;
|
170
|
134 }
|
|
135
|
|
136 short f(short i,unsigned short j,unsigned short k,short m,short a)
|
|
137 {
|
|
138 return i+j*k-m/a;
|
|
139 }
|
|
140
|
|
141 unsigned
|
|
142 short g(short i,unsigned short j,unsigned short k,short m,short a)
|
|
143 {
|
|
144 return i+j*k-m/a;
|
|
145 }
|