倒排高级算法

来源:互联网 发布:sql按周统计数据 编辑:程序博客网 时间:2024/06/05 03:11

这算法贼六。。。

#include <iostream>using namespace std;string FirstReverse(string str) {   // code goes here     for(int i=0,j=str.length()-1;i<str.length()/2;i++,j--)  {    str[i]^=str[j]^=str[i]^=str[j];   }  return str; }int main() {   // keep this function call here  cout << FirstReverse(gets(stdin));  return 0;}