-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutils.h
34 lines (31 loc) · 1.06 KB
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef UTILS_H
#define UTILS_H
#define CHECK_CU_GLOBAL() \
do { \
CU_ErrorCode c = CU_get_error(); \
if (CUE_SUCCESS != c) { \
printf("%s", CU_get_error_msg()); \
return c; \
} \
} \
while (0)
#define CHECK_CU_RETURN(res) \
do { \
if (CUE_SUCCESS != (res)) { \
printf("%s", CU_get_error_msg()); \
return (res); \
} \
} \
while (0)
/**
* 输出数组
*/
void print_array(int nums[], int len);
void print_array2(int **nums, int rows, int cols);
void swap(int nums[], int a, int b);
int maxnum(int a, int b);
int minnum(int a, int b);
int get_ith_dgt(int num, int i);
int get_dgt_cnt(int num);
void shuffle(int nums[], int len);
#endif