Rev 9242 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9242 | Rev 9262 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | #include |
|
1 | #include |
2 | #include |
2 | #include |
3 | #include |
3 | #include |
4 | #include |
4 | #include |
5 | #include |
- | 6 | #include |
|
Line 5... | Line 7... | ||
5 | 7 | ||
6 | int comp(void *a, void *b) { |
8 | int comp(void *a, void *b) { |
7 | return *(int*)a - *(int*)b; |
9 | return *(int*)a - *(int*)b; |
Line 66... | Line 68... | ||
66 | 68 | ||
67 | end = NULL; |
69 | end = NULL; |
68 | assert(strtod(start, &end) == 100.0); |
70 | assert(strtod(start, &end) == 100.0); |
Line 69... | Line -... | ||
69 | assert(!strcmp(end, " Rub")); |
- | |
70 | - | ||
71 | // rand ¨ srand ¯à®¢¥à¥ë ¢àãçãî :3 |
71 | assert(!strcmp(end, " Rub")); |
72 | 72 | ||
Line 73... | Line 73... | ||
73 | char *st3 = "21.3e3Hello World!"; |
73 | char *st3 = "21.3e3Hello World!"; |
74 | assert(atof(st3) == 21300.0); |
74 | assert(atof(st3) == 21300.0); |
75 | 75 | ||
76 | int nums[10] = {5, 3, 9, 1, 8, 4, 2, 0, 7, 6}; |
76 | int nums[10] = {5, 3, 9, 1, 8, 4, 2, 0, 7, 6}; |
77 | qsort(nums, 10, sizeof(int), (int(*) (const void *, const void *))comp); |
77 | qsort(nums, 10, sizeof(int), (int(*) (const void *, const void *))comp); |
Line -... | Line 78... | ||
- | 78 | for (int i = 0; i < 10; i++) { |
|
- | 79 | assert(nums[i] == i); |
|
- | 80 | } |
|
- | 81 | ||
78 | for (int i = 0; i < 10; i++) { |
82 | time_t libc_time = time(NULL); |
79 | assert(nums[i] == i); |
83 | struct tm *libc_tm = localtime(&libc_time); |
80 | } |
84 | printf(asctime(libc_tm)); |
81 | 85 |