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