玲珑学院 1127 咸鱼文章

1127 - 咸鱼文章

Time Limit:1s Memory Limit:128MByte

Submissions:474Solved:196

DESCRIPTION

elttiL moT nwod eht teerts sllac ruo god " ehT peek god " . piZ si a peehs god . tuB nehw moT seirt ot yas " peeS " , ti semoc tuo " peek " . dnA ni a yaw moT si thgir . piZ si syawla gnignirb sgniht oh rof su ot peek ! ll‘I llet uoy tuoba emos fo meht .
s‘piZ tsrif tneserp saw a eohs . tI saw edam fo neerg klis .
eW t‘ndid wonk woh piZ dnuof eht eohs . tuB retfa a tnemom yraM , ym gib retsis , dlot em eht eohs dah a egnarts llems . I deddon dna dleh ym eson . " tahW od uoy kniht ti si ? "
" tI sllems ekil gnihtemos rof gninaelc . I kniht enoemos deirt ot naelc a tops ffo eht eohs . nehT eh tup ti ta eht rood ot yrd . "
" gnolA emac piZ . dnA eyb-doog eohs ! " I dias . " eW dluohs ekat ti kcab . "
" eW t‘nac " . dias ym rettsis .
" ebyaM elttil moT si thgir , " yraM dias . " ebyaM piZ si a peek god ! "

你正在做英语阅读,可哪知这是一篇咸鱼文章,整个文章的所有单词都是翻转的,你很慌。

不过你是咸鱼程序员,你可以写代码将这篇文章翻转回来,那么翻转回来吧。

INPUT

输入一篇英文文章。

输入数据中只包含空格、换行符和小写大写字母。

满足总字数小于等于100000

OUTPUT

你应该把这个文章的所有单词都翻转回来,输出即可。

SAMPLE INPUT

AAA BBB
AB AB

SAMPLE OUTPUT

AAA BBB
BA BA

注意格式,不要多输出空行

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
vector<string>v;
char ch;
int main()
{
    string s,ss;
    while((ch=getchar())!=EOF)
    {
        if((ch>=‘a‘ && ch<=‘z‘) || (ch>=‘A‘ && ch<=‘Z‘))
            s+=ch;
        else
        {
            if(s.size()>0)
            {
                reverse(s.begin(),s.end());
                v.push_back(s);
                s="";
            }
            ss+=ch;
            v.push_back(ss);
            ss="";
        }
    }
    for(vector<string>::iterator it=v.begin();it!=v.end();it++)
    {
        cout<<*it;
    }
    return 0;
}

时间: 2024-10-11 11:45:51

玲珑学院 1127 咸鱼文章的相关文章

1127 - 咸鱼文章

Time Limit:1s Memory Limit:128MByte Submissions:488Solved:200 DESCRIPTION elttiL moT nwod eht teerts sllac ruo god " ehT peek god " . piZ si a peehs god . tuB nehw moT seirt ot yas " peeS " , ti semoc tuo " peek " . dnA ni a

玲珑学院 1128 咸鱼拷问

1128 - 咸鱼拷问 Time Limit:3s Memory Limit:128MByte Submissions:367Solved:112 DESCRIPTION 给你两个序列A,B.每个序列有N个元素,我们定义第i个位置的咸鱼值为min(A[i],A[i-1]-A[i-B[i]+1])*max(A[i],A[i-1]-.A[i-B[i]+1]).. 现在咸鱼王想知道所有的咸鱼值,于是抓住了你,让你回答这道题.你能回答他吗? INPUT 第一行包括一个整数N(1<=N<=1e5) 第二

玲珑学院 1138 - 震惊,99%+的中国人都会算错的问题

1138 - 震惊,99%+的中国人都会算错的问题 Time Limit:4s Memory Limit:128MByte Submissions:310Solved:87 DESCRIPTION 众所周知zhu是一个大厨,zhu一直有自己独特的咸鱼制作技巧.tang是一个咸鱼供应商,他告诉zhu在他那里面有N 条咸鱼(标号从1到N)可以被用来制作.每条咸鱼都有一个咸鱼值Ki,初始时Ki都是0:zhu是一个特别的人,他又M个咸数(咸鱼数字),对于每个咸数x,他都会满足所有标号是x倍数的咸鱼的咸鱼

玲珑学院 1149 - Buildings

题意:给出N,k,长度为N的数列,问有多少个区间满足区间最大值-区间最小值<=k 思路:RMQ+二分 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=2e5+10; 5 int a[N],b[N]; 6 int dp1[N][20],dp2[N][20]; 7 int n,k; 8 9 void init(){ 10 memset(dp2,127,sizeof(d

玲珑学院 1052 - See car

1052 - See car Time Limit:2s Memory Limit:64MByte Submissions:594Solved:227 DESCRIPTION You are the god of cars, standing at (a, b) point.There are some cars at point (xi,yi), . If lots of cars and you are in one line, you can only see the car that i

玲珑学院 1050 - array

1050 - array Time Limit:3s Memory Limit:64MByte Submissions:494Solved:155 DESCRIPTION 2 array is an array, which looks like: 1,2,4,8,16,32,64......a1=1 ,a[i+1]/a[i]=2; Give you a number array, and your mission is to get the number of subsequences ,wh

玲珑学院OJ 1028 - Bob and Alice are playing numbers 字典树,dp

http://www.ifrog.cc/acm/problem/1028 题解处:http://www.ifrog.cc/acm/solution/4 #include <cstdio> #include <cstring> #include <queue> #include <cmath> #include <algorithm> using namespace std; typedef long long LL; const int N =

玲珑学院 1010 - Alarm

1010 - Alarm Time Limit:1s Memory Limit:128MByte DESCRIPTION Given a number sequence [3,7,22,45,116,...] . Please tell me the k -th number. INPUT A number T (T<100) indicates the number of the input cases. Then for each case there only is one integer

玲珑学院OJ 1023 - Magic boy Bi Luo with his excited math problem 树状数组暴力

分析:a^b+2(a&b)=a+b  so->a^(-b)+2(a&(-b))=a-b 然后树状数组分类讨论即可 链接:http://www.ifrog.cc/acm/problem/1023 吐槽:这个题本来是mod(2^40),明显要用快速乘啊,但是用了以后狂T,不用反而过了,不懂出题人 #include <iostream> #include <algorithm> #include <cmath> #include <vector&g