Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 06.02.2020.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <stack>
- #include <queue>
- using namespace std;
- int main()
- {
- /*stack <char> stk;
- queue <char> que;
- bool flag = false;
- string S;
- getline(cin, S);
- for (int i = 0; i < S.length(); i++) {
- stk.push(S[i]);
- que.push(S[i]);
- }
- for (int i = 0; i < S.length(); i++) {
- char a = stk.top();
- char b = que.front();
- if (a == b) {
- stk.pop();
- que.pop();
- }
- else { flag = true; }
- };
- if (flag) { cout << "Not palindrom \n"; }
- else { cout << "Is Palindrom \n"; }*/
- queue <char> que;
- string S;
- getline(cin, S);
- for (int i = 0; i < S.length(); i++) {
- if (S[i] == ' ')
- que.push(S[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement