1017: 字符串正反连接

Description

所给字符串正序和反序连接,形成新串并输出

Input

任意字符串(长度<=50)

Output

字符串正序和反序连接所成的新字符串

Sample Input

123abc

Sample Output

123abccba321

#include<iostream>
#include<string.h>
using namespace std;
int main()
{
    char a[100];
    gets(a);
    cout<<a;
    int i,j,s=strlen(a);
    for(i=s-1; i>=0; i--)
    {
        cout<<a[i];
    }
}

猜你喜欢

转载自blog.csdn.net/meng1ge/article/details/81148049
今日推荐