FZU-1054 阅读顺序(水、反转字符串处理)
2016-04-24 09:15
525 查看
FZU-1054 阅读顺序(水、反转字符串处理)
题目链接题意:反转字符串
#include"iostream" #include"cstring" #include"cstdio" using namespace std; int main(){ int t,i,len; char s[250]; scanf("%d",&t); getchar(); while(t--){ gets(s); len = strlen(s); for(i=len-1; i>=0; i--){ printf("%c",s[i]); } printf("\n"); } return 0; }
其实还有更简单的,直接调用C语言库里的反转字符串函数strrev(),必须用Visual C++/C提交一般GUN里面木有这个函数
#include"cstring" #include"cstdio" using namespace std; int main(){ int t,i,len; char s[250]; scanf("%d",&t); getchar(); while(t--){ gets(s); printf("%s\n",strrev(s)); } return 0; }
相关文章推荐
- LeetCode 303. Range Sum Query - Immutable
- 【BZOJ-1692&1640】队列变换 后缀数组 + 贪心
- 学习进度条——第八周
- 金山游侠修改内存
- 中医
- 【GDOI 2016模拟4.23】闷声
- hdu 2089 不要62 (数位DP)
- HDU-1219 AC Me (水)
- Activity的常用方法和生命周期
- 搜狗输入法人机交互设计的用户体验
- kvm 网桥
- 【HDU 3037】Saving Beans
- FZU-2182 水题
- 从Java future 到 Guava ListenableFuture实现异步调用
- 好日子
- HDU-1229 还是A+B
- urllib.parse.quote
- 电脑硬件参数
- [网站安全] [实战分享]WEB漏洞挖掘的一些经验分享
- Android 简单模仿AsyncHttpClient