程序填空题:交换2个变量的值
输入2个整数a和b,交换其值,然后输出a和b的值。
```c++
#include
int main(void)
{
int a, b, temp;
scanf("%d%d", &a, &b);
@@[temp = a](1);
a = b;
@@[b = temp](1);
printf("%d %d\n", a, b);
return 0;
}
```
答案:
第1空:temp = a
第2空:b = temp
```c++
#include
int main(void)
{
int a, b, temp;
scanf("%d%d", &a, &b);
@@[temp = a](1);
a = b;
@@[b = temp](1);
printf("%d %d\n", a, b);
return 0;
}
```
答案:
第1空:temp = a
第2空:b = temp