两指针相加减
#include <stdio.h> #include <stdlib.h>void update(int *a,int *b) { *a = *a + *b; *b = abs(*a -(2**b)); // Complete this function }
int main() { int a, b; int *pa = &a, *pb = &b; scanf("%d %d", &a, &b); update(pa, pb); printf("%d\n%d", a, b);
return 0; } (注:函数abs用来计算两数差的绝对值)