1159: 零起點學算法66——反話連篇
Time Limit: 1 Sec Memory Limit: 64 MB 64bit IO Format: %lldSubmitted: 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 }
//對字符串的處理,很重要!!