题解 | #按照格式输入并交换输出#
按照格式输入并交换输出
http://www.nowcoder.com/practice/95eb723a3e854376a7eb6d116cc7d875
#include<stdio.h> void Stmp_Num(int * a, int * b) //利用整型指针接收整型变量的地址 { int stmp = *a; //将两变量值交换 *a = *b; *b = stmp; } int main() { int a = 1; int b = 2; scanf("a=%d,b=%d", &a, &b); Stmp_Num(&a, &b); //传址的调用 printf("a=%d,b=%d", a, b); return 0; }