SDUT-1173 字符逆序

来源:互联网 发布:中电四公司怎么样 知乎 编辑:程序博客网 时间:2024/05/16 05:34

字符逆序

Time Limit: 1000MS Memory Limit: 65536KB
Submit Statistic Discuss

Problem Description

将一个字符串str的内容颠倒过来,并输出。str的长度不超过100个字符。

Input

输入包括一行。 
第一行输入的字符串。

Output

输出转换好的逆序字符串。

Example Input

I am a student

Example Output

tneduts a ma I

Code

#include <stdio.h>#include <string.h>int main(){    char s[101];    int len,i;    gets(s);    len=strlen(s);    for(i=len-1;i>=0;i--)        printf("%c",s[i]);    return 0;}


原创粉丝点击