zoukankan      html  css  js  c++  java
  • UVa 10361 Automatic Poetry

    #include<iostream>
    #include<string>
    using namespace std;
    int main()
    {
    long n;
    cin>>n;
    getchar();
    for(long cas=1;cas<=n;cas++)
    {
    string a,b,ans;
    getline(cin,a);
    for(long i=0;a[i];i++)
    if(a[i]!='<'&&a[i]!='>')
    cout<<a[i];
    cout<<endl;
    // Print the First Line
    getline(cin,b);
    // Read In stringA and stringB

    long j,pos[5]={0};
    j=0;
    for(long i=0;a[i];i++)
    if(a[i]=='<'||a[i]=='>')
    {
    j++;
    pos[j]=i;
    }
    // Get Four Positions

    string _1="",_2="",_3="",_4="";
    for(long i=pos[1]+1;i<=pos[2]-1;i++)
    _1+=a[i];
    for(long i=pos[2]+1;i<=pos[3]-1;i++)
    _2+=a[i];
    for(long i=pos[3]+1;i<=pos[4]-1;i++)
    _3+=a[i];
    for(long i=pos[4]+1;a[i];i++)
    _4+=a[i];

    ans="";
    for(long i=0;b[i];i++)
    {
    if(b[i]!='.')
    ans+=b[i];
    else
    {
    ans+=_3+_2+_1+_4;
    break;
    }
    }
    cout<<ans<<endl;
    // Print the Secont Line
    }
    return 0;
    }
  • 相关阅读:
    Flink 双流合并之connect Demo2
    Flink 双流合并之connect Demo1
    Flink 双流合并Join
    Flink状态保存CheckPoint
    Flink状态之OperatorState
    Flink状态之AggregateState
    Flink状态之ReduceState
    Flink状态之MapState
    Flink状态之KeyedListState
    大数据框架环境安装与配置01--服务器基本设置
  • 原文地址:https://www.cnblogs.com/rollenholt/p/2410761.html
Copyright © 2011-2022 走看看