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位正整数的后两位互换.md

38 lines
642 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 6-5 两个4位正整数的后两位互换
将输入的任意两个4位正整数的后两位互换例如输入1234和5678交换之后输出1278和5634。
### 函数接口定义:
```c++
void fun(int *p,int *q);
```
其中` p `和 `q` 是用户传入的参数。函数将指针`p`所指整数与指针`q`所指的整数的后两位互换。
### 裁判测试程序样例:
```c++
void fun(int *p,int *q);
int main()
{int a,b;
scanf("%d%d",&a,&b);
fun(&a,&b);
printf("%5d%5d\n",a,b);
return 0;
}
/* 请在这里填写答案 */
```
### 输入样例:
```in
1234 5678
```
### 输出样例:
```out
1278 5634
```