问题 S: 高程07-07:编写函数,将字符串中的字符倒置

问题 S: 高程07-07:编写函数,将字符串中的字符倒置

时间限制: 1 Sec  内存限制: 128 MB
提交: 1840  解决: 1334
[提交][状态][讨论版][命题人:]

题目描述

编写函数,将字符串中的字符倒置。 (要求用数组和指针)


#include <stdio.h>

#include <string.h>

void invert(char s[])

{

      //在这里添加函数体

}

 

int main()

{

      char s[100];

      scanf("%s",&s);

      //fflush(stdin);

      invert(s);

      printf("%s",s);

      return 0;

}


输入

输入字符串

输出

输出倒置后的字符串

样例输入

abc

样例输出

cba

提示

[提交][状态]