首页 > 代码库 > 1159: 零起点学算法66——反话连篇
1159: 零起点学算法66——反话连篇
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——反话连篇
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。