将s所指字符串的正序和反序进行连接,形成一个新串放在t所指的数组中。

函数接口定义:

void fun (char  *s, char  *t);

其中st都是用户传入的参数。函数将s所指字符串的正序和反序进行连接,形成一个新串放在t所指的数组中。

裁判测试程序样例:

#include  <stdio.h>
void fun (char *s, char *t);
int main()
{ char s[100], t[100];
scanf("%s", s);
fun(s, t);
printf("The result is: %s\n", t);
return 0;
} /* 请在这里填写答案 */

输入样例:

abcd

输出样例:

The result is: abcddcba
void fun (char  *s, char  *t)
{
int len = 0;
while(*s != '\0')
{
*t = *s;
s++;
t++;
len++;
}
s--;
while(len--)
{
*t = *s;
s--;
t++;
}
*t = '\0';
}

最新文章

  1. JQuery中隐藏/显示事件函数
  2. angularjs自动化测试系列之jasmine
  3. UVa1401 Remember the Word(DP+Trie树)
  4. 关于C语言链表的学习
  5. Android中View转换为Bitmap及getDrawingCache=null的解决方法
  6. [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]ExI.2.4
  7. C# Byte[]数组读取和写入文件
  8. Alamofire网络库基础教程
  9. LeetCode219:Contains Duplicate II
  10. sql server 去除字符中空格的方法
  11. 201521123074 《Java程序设计》第10周学习总结
  12. 读书笔记二 How Does the Internet work?
  13. 解决关于ios访问相机闪退问题
  14. docker 系列 - Dock高阶知识点文章汇集
  15. WebService简单教程
  16. python 3 操作mysql数据库的方法
  17. HBase定期备份
  18. High Voltage Boost Supply
  19. Java 引用类型变量的声明和使用
  20. 【BZOJ2818】Gcd [莫比乌斯反演]

热门文章

  1. [HarekazeCTF2019]baby_rop
  2. IDT系统中断描述表以及绕过Xurtr检测的HOOK姿势
  3. CF46B T-shirts from Sponsor 题解
  4. CF1491A K-th Largest Value 题解
  5. Linux 输入指令显示 command not found(未找到命令)解决办法
  6. 【LeetCode】1414. 和为 K 的最少斐波那契数字数目 Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
  7. 【LeetCode】518. Coin Change 2 解题报告(Python)
  8. 分析一个简单的goroutine资源池
  9. 第三十三个知识点:Bellcore攻击是如何攻击使用CRT的RSA的?
  10. Proximal Algorithms 4 Algorithms