HDU 1062 Text Reverse
来源:互联网 发布:java获取昨天时间戳 编辑:程序博客网 时间:2024/04/27 16:04
字符串的倒置,注意字符串接受和个别细节就ok了,接受cas的时候,下面接受字符用getchar()接受换行符,否则换行符会当输入数据接收的。
#include <iostream>#include <cstdio>#include <cstring>#define nMax 1024using namespace std;string s1;char s[nMax];char c;int main(int argc, char *argv[]){ int cas,j=0; scanf("%d",&cas); getchar(); while(cas--) { while(scanf("%c",&c)&&c!='\n') { if(c==' ') { int len=j; for(int i=len-1; i>=0; i--) { printf("%c",s[i]); } printf(" "); j=0; } else { s[j++]=c; } } int len=j; for(int i=len-1; i>=0; i--) { printf("%c",s[i]); } printf("\n"); j=0; } return 0;}
- hdu 1062 Text Reverse
- hdu 1062 Text Reverse
- HDU 1062 TEXT REVERSE
- Hdu 1062 - Text Reverse
- hdu 1062 Text Reverse
- HDU 1062 Text Reverse
- hdu 1062 Text Reverse
- HDU 1062 Text Reverse
- HDU 1062 - Text Reverse
- hdu 1062 Text Reverse
- hdu 1062 Text Reverse
- Text Reverse(hdu 1062)
- hdu 1062 Text Reverse
- HDU 1062 Text Reverse
- hdu 1062 text reverse
- HDU 1062 Text Reverse
- HDU 1062 Text Reverse
- hdu 1062 Text Reverse
- 备忘
- Qt正则表达式
- Android应用-交互式图形界面设计新趋势
- WCF揭秘之基础知识实例-vs2010下调试通过
- 强制类型转换
- HDU 1062 Text Reverse
- JsonCPP在linux下的一个奇怪的问题
- 求1+2+3+...+100的值(1)
- PPS研发类C++笔试题目
- HDU 2544 Dijkstra 最短路
- 求1+2+3+..+100的值(2)
- java程序实现1分2分5分组成1角的组合次数
- 求1+2+3+..+100的值(3)
- 软件测试面试问答大全