Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
3725 | 王冯俊 | 字符串反转 | C++ | 解答错误 | 0 | 0 MS | 256 KB | 571 | 2019-12-21 15:17:39 |
#include <iostream> using namespace std; int i; #include <stdio.h> #include <cstring> #define A 1000+5 int main() { char ch[A]; int position1=0,position2; gets(ch); int len=strlen(ch); ch[len]=' '; for(i=0;i<=len;i++) { if(ch[i]==' ') { position2=i; for(int j=position2-1;j>=position1;j--) { cout<<ch[j]; } cout<<" "; position1=position2+1; } } cout<<endl; return 0; }