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