??????oj Problem L: CreatorX????????????STL???

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了??????oj Problem L: CreatorX????????????STL???相关的知识,希望对你有一定的参考价值。

???????????????   beautiful   end   ??????   vector   fstream   ??????   ??????   fun   

Problem L: CreatorX?????????
Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 53  Solved: 36
[Submit][Status][Web Board]
Description
CreatorX???????????????????????????

Hzk is a young and beautiful and cute boy

??????????????????????????????????????????????????????????????????????????????????????????

Boy cute and beautiful and young a is Hzk

?????????????????????????????????????????????????????????(??????????????????)?????????????????????????????????????????????????????????????????????????????????,

Input
?????????????????????T????????????????????????(T<=20)

?????????????????????????????????????????????????????????????????????s(0<|s|<=2000),???????????????????????????,???????????????????????????????????????????????????????????????.

Output
????????????????????????????????????????????????????????????????????????.

Sample Input
2
Hzk,is,a,young,and,beautiful,and,cute,boy
abc,def
Sample Output
boy,cute,and,beautiful,and,young,a,is,Hzk
def,abc
HINT


?????????hint???QaQ


?????????????????????????????????????????????getchar()?????????????????????????????????????????????????????????
#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <map>
#include <bitset>
#include <set>
#include <vector>
#include <sstream>
using namespace std;

const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const double eps = 1e-15;
typedef long long ll;
typedef pair <int, int> PLL;
vector<string> v;

int main()
{
   int t;
   cin>>t;
   t++;
   while(t--)
   {
       string s,buf;
       getline(cin,s);

       stack<string> st;
       while( !st.empty() )
            st.pop();

       for(int i=0;i<s.size();i++)
       {
           if(s[i]==',') s[i]=' ';
       }
       int k=0;
       stringstream ss(s);
       while(ss>>buf)
       {
           st.push(buf);
           k++;
       }

       int f=0;
       while(!st.empty())
       {
           f++;
           if(f == k) {
              cout<<st.top()<<endl;
           }
           else
              cout<<st.top()<<",";
           st.pop();
       }
   }
}

以上是关于??????oj Problem L: CreatorX????????????STL???的主要内容,如果未能解决你的问题,请参考以下文章

上交oj1002遇到困难

Light oj 1005 - Rooks (找规律)

Light oj 1100 - Again Array Queries (鸽巢原理+暴力)

(light oj 1102) Problem Makes Problem (组合数 + 乘法逆元)

Light OJ 1314 Names for Babies

[bzoj3489]A simple rmq problem