1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】13.指针1/6-5 两个4位正整数的后两位互换.c

10 lines
178 B
C

void fun(int *p, int *q) {
int p_s = *p / 100,
p_e = *p % 100;
int q_s = *q / 100,
q_e = *q % 100;
*p = p_s * 100 + q_e;
*q = q_s * 100 + p_e;
}