Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma comment(linker, "/STACK:128777216")
- #include <bits/stdc++.h>
- #define _USE_MATH_DEFINES
- using namespace std;
- typedef unsigned long long ull;
- typedef double dbl;
- typedef long double ldbl;
- typedef long long ll;
- typedef pair<ll,ll> pll;
- typedef string str;
- typedef vector<int> vi;
- typedef vector<ll> vll;
- typedef vector<bool> vbl;
- #define gepard ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- #define perfect cout << setprecision(5) << fixed;
- char a;
- stack<char> q;
- int main () {
- gepard
- while (cin.get(a)){
- if(isalpha(a)){
- q.push(a);
- }
- else{
- if (!q.empty()){
- int size=q.size();
- for (int i=0; i<size; ++i){
- cout << q.top();
- q.pop();
- }
- }
- cout << a;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement