#include #include #include using namespace std; bool ppkt_b(string); int main() { string napis; getline(cin, napis); cout< stos; char tabo[] = { '(','[','{','<' }; char tabz[] = { ')',']','}','>' }; //////////////////Wrzucenie na stos otwierajacych for (int i = 0;i < nap.length();i++) { for (int j = 0;j < 4;j++) { if(nap[i]==tabo[j]) stos.push(nap[i]); if (nap[i] == tabz[j]) { for (int k = 0;k < 4;k++) { if (stos.top() == tabo[k]) { if (j == k) { stos.pop(); break; } } } } } if ((i < nap.length() - 1) && (stos.empty() == true)) return false; } if (stos.empty()) return true; else return false; }