193
|
1
|
|
2 long long gj;
|
|
3 long long gi;
|
|
4
|
|
5 long long a[100];
|
|
6 unsigned long long b[100];
|
|
7 unsigned long long c[100];
|
|
8
|
279
|
9 long long data[] = {2342342342304234LL,2342342340234234LL,
|
|
10 -234234342340234LL, -2342342342340234LL };
|
193
|
11 unsigned long long udata[] = {2342342334234LL,23423423434234LL,
|
279
|
12 -23423423234234LL, -234234234234234LL};
|
193
|
13
|
|
14 long long f(long long i,unsigned long long j,unsigned long long k,long long m,long long a);
|
|
15 unsigned
|
|
16 long long g(long long i,unsigned long long j,unsigned long long k,long long m,long long a);
|
|
17
|
|
18 void
|
|
19 test3();
|
|
20
|
|
21 float f2ll(long long i) { float r;
|
|
22 r = i ;
|
|
23 return r; }
|
|
24 double d2ll(long long i) { double r;
|
|
25 r = i ;
|
|
26 return r; }
|
|
27 float f2ull(unsigned long long i) { float r;
|
|
28 r = i ;
|
|
29 return r; }
|
|
30 double d2ull(unsigned long long i) { double r;
|
|
31 r = i ;
|
|
32 return r; }
|
|
33 long long ll2f(float f) { long long r;
|
|
34 r = f ;
|
|
35 return r; }
|
|
36 long long ll2d(double d) { long long r;
|
|
37 r = d ;
|
|
38 return r; }
|
|
39 unsigned long long ull2f(float f) { unsigned long long r;
|
|
40 r = f ;
|
|
41 return r; }
|
|
42 unsigned long long ull2d(double d) { unsigned long long r;
|
|
43 r = d ;
|
|
44 return r; }
|
|
45
|
|
46 main()
|
|
47 {
|
233
|
48 long long int ii;
|
193
|
49 long long i,k,*p;
|
|
50 unsigned long long j,m,*up;
|
|
51 unsigned long long g0,h0;
|
|
52 long long g1,h1;
|
|
53 unsigned long long sg0,sh0;
|
|
54 long long sg1,sh1;
|
|
55 unsigned long long *pg0,*ph0;
|
|
56 long long *pg1,*ph1;
|
|
57 unsigned long long *psg0,*psh0;
|
|
58 long long *psg1,*psh1;
|
|
59
|
|
60
|
|
61 i = -2343423423424234234LL;
|
|
62 j = 3424223422342234224LL;
|
|
63 k = 44;
|
|
64 k = i*j+3+k;
|
|
65 m = i*j-7+k;
|
|
66 printf("%lld %lld %llu\n",i,k,m);
|
|
67 printf("%lld %lld %llu\n",i,1231234234233LL,m);
|
222
|
68 printf("0x%llx 0x%llx 0x%llx\n",i,k,m);
|
|
69 printf("0x%llx 0x%llx 0x%llx\n",i,1231234234233LL,m);
|
193
|
70
|
|
71 g0 = -2343423423424234234LL;
|
|
72 g0++; --g0;
|
|
73 ++g0; g0--;
|
|
74 printf("g0=%lld\n",g0);
|
222
|
75 printf("g0=0x%llx\n",g0);
|
193
|
76 g1 = -2343423423424234234LL;
|
|
77 g1++; --g1;
|
|
78 ++g1; g1--;
|
|
79 printf("g1=%lld\n",g1);
|
222
|
80 printf("g1=0x%llx\n",g1);
|
193
|
81
|
|
82 sg0 = 2343423423424234234LL;
|
|
83 sg0++; --sg0;
|
|
84 ++sg0; sg0--;
|
|
85 printf("sg0=%lld\n",sg0);
|
|
86 sg1 = -2343423423424234234LL;
|
|
87 sg1++; --sg1;
|
|
88 ++sg1; sg1--;
|
|
89 printf("sg1=%lld\n",sg1);
|
|
90
|
|
91 pg0 = &g0;
|
|
92 ph0 = &h0;
|
|
93 *pg0 = -2343423423424234234LL;
|
|
94 //*pg0++; *--pg0;
|
|
95 //*++pg0; *g0--;
|
|
96 printf("g0=%lld\n",*pg0);
|
|
97 pg1 = &g1;
|
|
98 ph1 = &h1;
|
|
99 *pg1 = -2343423423424234234LL;
|
|
100 //*pg1++; --*pg1;
|
|
101 //++*pg1; *pg1--;
|
|
102 printf("g1=%lld\n",*pg1);
|
|
103
|
|
104 psg0 = &sg0;
|
|
105 psh0 = &sh0;
|
|
106 *psg0 = -2343423423424234234LL;
|
|
107 //*sg0++; *--sg0;
|
|
108 //*++sg0; *sg0--;
|
|
109 printf("sg0=%lld\n",*psg0);
|
|
110 psg1 = &sg1;
|
|
111 psh1 = &sh1;
|
|
112 *psg1 = -2343423423424234234LL;
|
|
113 //*sg1++; *--sg1;
|
|
114 //*++sg1; *sg1--;
|
|
115 printf("sg1=%lld\n",*psg1);
|
|
116
|
|
117
|
|
118 h0 = g0 - 20;
|
|
119 c[33] = g0;
|
|
120
|
|
121 if (i==j) { printf("i==j\n"); } else { printf("i!=j\n"); }
|
|
122
|
|
123 a[33] = i;
|
|
124 b[33] = 2342342342342342342LL;
|
|
125 printf("i=%lld\n",i);
|
|
126 printf("j=%lld\n",j);
|
|
127 i++; --i;
|
|
128 j++; --j;
|
|
129 printf("i=%lld\n",i);
|
|
130 printf("j=%lld\n",j);
|
|
131 gi = 2342342342342342342LL;
|
|
132 gj = 2342342342342342342LL;
|
|
133 gi++; --gi;
|
|
134 gj++; --gj;
|
|
135 printf("gi=%lld\n",gi);
|
|
136 printf("gj=%lld\n",gj);
|
|
137
|
|
138 printf("k=%lld\n",k);
|
|
139 printf("m=%lld\n",m);
|
222
|
140 printf("k=0x%llx\n",k);
|
|
141 printf("m=0x%llx\n",m);
|
193
|
142 printf("a[33]=%lld\n",a[33]);
|
|
143 printf("b[33]=%lld\n",b[33]);
|
|
144 printf("a[33]=%lld\n",++a[33]);
|
|
145 printf("b[33]=%lld\n",b[33]--);
|
|
146
|
|
147 printf("g0=%lld\n",g0);
|
|
148 printf("h0=%lld\n",h0);
|
|
149 printf("c[33]=%lld\n",c[33]);
|
|
150
|
|
151 p = data;
|
|
152 printf("*p++ = %lld\n",*p++);
|
|
153 printf("*++p = %lld\n",*++p);
|
|
154 *p++ = -2342342342342342342LL;
|
|
155 printf("*p-- = %lld\n",*p--);
|
|
156 printf("*--p = %lld\n",*--p);
|
|
157 up = udata;
|
|
158 printf("*up-- = %lld\n",*up--);
|
|
159 printf("*--up = %lld\n",*--up);
|
|
160 *up++ = 65530;
|
|
161 printf("*up-- = %lld\n",*up--);
|
|
162 printf("*--up = %lld\n",*--up);
|
|
163
|
232
|
164 printf("f(%lld %llu %llu %lld %lld)\n",i,j,k,m,a[33]);
|
193
|
165
|
|
166 ii = f(i,j,k,m,a[33]);
|
|
167 printf("f()=%lld\n",ii);
|
222
|
168 printf("f()=0x%llx\n",ii);
|
193
|
169 ii = g(i,j,k,m,a[33]);
|
222
|
170 printf("g()=%lld\n",ii);
|
|
171 printf("g()=0x%llx\n",ii);
|
193
|
172 test3();
|
|
173 return 0;
|
|
174 }
|
|
175
|
|
176 long long f(long long i,unsigned long long j,unsigned long long k,long long m,long long a)
|
|
177 {
|
232
|
178 printf("f(%lld %llu %llu %lld %lld)\n",i,j,k,m,a);
|
193
|
179 return i+j*k-m/a;
|
|
180 }
|
|
181
|
|
182 unsigned
|
|
183 long long g(long long i,unsigned long long j,unsigned long long k,long long m,long long a)
|
|
184 {
|
|
185 return i+j*k-m/a;
|
|
186 }
|
|
187
|
|
188 void
|
|
189 test3()
|
|
190 {
|
244
|
191 printf("test3-1:%g\ntest3-2:%g\ntest3-3:%g\ntest3-4:%g\ntest3-5:%lld\ntest3-6:%lld\ntest3-7:%llu\ntest3-8:%llu\n",
|
193
|
192 f2ll((long long ) -3423423234234LL),
|
|
193 d2ll((long long ) -3423423234234LL),
|
|
194 f2ull((unsigned long long ) 34234234234234LL),
|
|
195 d2ull((unsigned long long ) 34234234234234LL),
|
244
|
196 ll2f((float ) 2342423423423424234LL),
|
193
|
197 ll2d((double ) 2344234234244234234LL),
|
|
198 ull2f((float ) 2344234234244234234LL),
|
|
199 ull2d((double )2332342343234234234LL)
|
|
200 );
|
|
201
|
|
202 }
|