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