您的位置:首页 > 其它

ZOJ_1295

2010-07-27 11:03 351 查看
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
const int MAX = 80;
int main(int argc, char *argv[])
{
//freopen("input.txt", "rt", stdin);
//freopen("output.txt", "wt", stdout);

char ch[MAX];
int flag = 0;

while(cin.getline(ch, 80))
{
if(flag == 0)
{
flag = 1;
continue;
}

int size = strlen(ch) - 1;
int hafSize = (size  + 1) / 2;

for(int i=0; i<hafSize; i++)
swap(ch[i], ch[size - i]);

cout << ch << endl;
}
return EXIT_SUCCESS;
}
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  include