数组逆置

题目描述

输入一个字符串,长度小于等于200,然后将数组逆置输出。

 

输入

测试数据有多组,每组输入一个字符串。

 

 

输出

对于每组输入,请输出逆置后的结果。

 

 

样例输入 Copy

tianqin

 

 

样例输出 Copy

niqnait
#include<bits/stdc++.h>
using namespace std;
int main(){
    char a[200]={};
    while(scanf("%s",a)!=EOF){
        for(int i=strlen(a)-1;i>=0;i--){
            cout<<a[i];
        }
        cout<<endl;
    }
}
 

 

posted @ 2020-09-09 21:10  Euclid·Guisi  阅读(204)  评论(0编辑  收藏  举报