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 }
//对字符串的处理,很重要!!
查看更多关于1159: 零起点学算法66——反话连篇的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did238292