实习实现输入俩个整数,然后将俩个数对调后输出
时间: 2023-04-04 15:01:25 浏览: 120
好的,这个问题很简单。可以使用一个临时变量来完成交换操作,代码如下:
```
#include <stdio.h>
int main() {
int a, b, temp;
printf("请输入俩个整数:\n");
scanf("%d%d", &a, &b);
temp = a;
a = b;
b = temp;
printf("交换后的结果为:%d %d\n", a, b);
return ;
}
```
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241231045021.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![application/x-zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![py](https://img-home.csdnimg.cn/images/20250102104920.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)