void yanghui_triangle() {
int c;
printf("几层:");
scanf("%d", &c);
int triangle[c][c];
int (*p)[c] = triangle;
for (int i = 0; i < c; ++i) {
for (int j = 0; j < c; ++j) {
if (j == 0 || i == j) {
*(*(p + i) + j) = 1;
} else {
*(*(p + i) + j) = *(*(p + i - 1) + j - 1) + *(*(p + i - 1) + j);
}
}
}
for (int i = 0; i < c; ++i) {
for (int j = 0; j <= i; ++j) {
printf("%4d", *(*(p + i) + j));
}
printf("\n");
}
}
void transpose_print() {
int arr[2][3];
int (*p)[3] = arr;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
scanf("%d", *(p + i) + j);
}
}
printf("\n");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
printf("%d", *(p[j] + i));
}
}
}
int str_cmp(char *s1, char *s2) {
while (1) {
if (*s1 - *s2) {
return *s1 - *s2;
}
if (*s1 == '\0' && *s2 == '\0') {
return 0;
}
++s1;
++s2;
}
}
char *str_cat(char *source, char *target) {
char *p = source;
while (*(p++));
p--;
while (*target) {
*p = *target;
p++;
target++;
}
return source;
}
void reverse_order_string() {
char *a = (char *) malloc(100);
fgets(a, 100, stdin);
unsigned long length = strlen(a);
for (int i = 0; i <= (length - 1) / 2; ++i) {
*(a + i) = *(a + i) ^ *(a + length - 1 - i);
*(a + length - 1 - i) = *(a + i) ^ *(a + length - 1 - i);
*(a + i) = *(a + i) ^ *(a + length - 1 - i);
}
printf("%s", a);
free(a);
}