From 3cbb76730345145c4db58e4ba297411ed577d6f3 Mon Sep 17 00:00:00 2001 From: Sameer Kumar Kushwaha <44394184+kushwahasameerkumar@users.noreply.github.com> Date: Wed, 9 Oct 2019 00:14:31 +0530 Subject: [PATCH] Validate Paranthesis A cpp program to Validate Paranthesis --- C programs/validate_paranthesis.cpp | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 C programs/validate_paranthesis.cpp diff --git a/C programs/validate_paranthesis.cpp b/C programs/validate_paranthesis.cpp new file mode 100644 index 0000000..8cc6be6 --- /dev/null +++ b/C programs/validate_paranthesis.cpp @@ -0,0 +1,49 @@ +#include +#include +#include +using namespace std; + +int main() +{ + int t; + cin>>t; + int buffer = 0; + while(t--){ + stack stack; + string str; + if(buffer == 1) + getline(cin, str); + else{ + getline(cin, str); + getline(cin, str); + } + int f =1 ; + for(int i=0; i