1159: 零起点学算法66——反话连篇


1159: 零起点学算法66——反话连篇

Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lld
Submitted: 1470  Accepted: 626
[Submit][Status][Web Board]

Description

把输入的字符按照反着顺序输出

 

Input

多组测试数据 
每组一行(每组数据不超过200个字符)

 

Output

按照输入的顺序反着输出各个字符

 

Sample Input

 
I am a boy.

 

Sample Output

.yob a ma I

 

Source

 
 1 #include<stdio.h>
 2 #include<string.h>
 3 int main(){
 4     char ch[200];
 5     while(gets(ch)!=NULL){
 6         int n;
 7         n=strlen(ch);
 8         for(int i=n-1;i>=0;i--){
 9             printf("%c",ch[i]);
10         }
11         printf("\n");
12     }
13     return 0;
14 } 

//对字符串的处理,很重要!!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM