1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】14.指针2/6-3 字符串反正序连接.md

36 lines
688 B
Markdown
Raw 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-3 字符串反正序连接
先将在字符串s中的字符按逆序存放到t串中然后把s中的字符按正序连接到t串的后面。
### 函数接口定义:
```c++
void fun (char *s, char *t);
```
其中` s `和 `t `都是用户传入的参数。函数先将在字符串`s`中的字符按逆序存放到`t`串中,然后把`s`中的字符按正序连接到`t`串的后面。
### 裁判测试程序样例:
```c++
#include <stdio.h>
void fun (char *s, char *t);
int main()
{ char s[100], t[100];
scanf("%s", s);
fun(s, t);
printf("%s\n", t);
return 0;
}
/* 请在这里填写答案 */
```
### 输入样例:
```in
abcd
```
### 输出样例:
```out
dcbaabcd
```