#include <stdio.h>
#include <time.h>
int main() {
clock_t start, end;
start = clock();
int a = 0x1;
int b = 0x3;
int sum = a + b;
if (sum == 0x3) {
printf("Output:0x%X\n",sum);
printf("Correct\n");
int c = 0x222;
int d = 0x12F;
int e = 0xCAA;
int sum1 = c + d + e;
printf("Output:0x%X\n",sum1);
}
else if (sum == 0x5) {
printf("Unknown\n");
}
else if (sum > 0x3) {
printf("Error\n");
long long f = 0xFAA409611232;
long long g = 0xFFFFB4476AAB;
long long sum2 = f + g;
printf("Output:%llX\n",sum2);
if (sum2 == 0x1FAA3BDA87CDD) {
printf("Correct!\n");
long long h = 0xEEADEFFF;
long long i = 0xAAA41289;
long long sum3 = h + i;
printf("Output:%llX\n",sum3);
if (sum3 == 0x199520288) {
printf("Yes!\n");
int x = 0x5201314;
int *p = &x;
printf("x The Address (original):%p\n",&x);
printf("x doorplate number (take address):%p\n",&x);
printf("p Printed real address:%p\n",p);
printf("The value found by following p:0x%X\n",*p);
*p = 0x514520;
printf("The value of x after modification:0x%X\n",x);
printf("The value of *p after modification:0x%X\n",*p);
int numbers[5] = {256, 26, 310, 4096, 500};
int sum4 = 0;
for (int i = 0; i < 5; i++) {
sum4 = sum4 + numbers[i];
}
printf("The sum of 5 is:%d\n",sum4);
if (sum4 == 5188) {
printf("Correct!\n");
int numbers2[15] = {256, 26, 310, 496, 500, 796, 224, 20, 10, 777, 111, 324, 121, 888, 520};
int *q = numbers2;
int idx = 0;
for (int idx = 0; idx < 15; idx++) {
printf("第 %d 个元素的值: %d, 地址: %p\n", idx, numbers[idx], &numbers[idx]);
}
}
else {
printf("Error!\n");
for (volatile int i = 0; i < 1000000000; i++);
printf("CPU waste 0.00000 second\n");
}
}
}
}
end = clock();
printf("Loop duration:%f second\n", (double)(end - start) / CLOCKS_PER_SEC);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: