Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Reverse polish notation
//clang 3.8.0 #include <iostream> #define MAX 400 int main() { int top=-1,testCase; char stack[MAX]; std::string cases; std::cin>>testCase; while(testCase--){ std::cin>>cases; for(int i=0;i<cases.length();i++ ) { if(cases[i]==')') { while(stack[top]!='(') { std::cout<<stack[top]; top-=1; } top-=1; } else { if(cases[i] >= 'a' && cases[i]<='z') std::cout<<cases[i]; else { top+=1; stack[top]=cases[i]; } } } std::cout<<std::endl; } return 0; }
run
|
edit
|
history
|
help
0
Merge Sort
Throttle Example in C++
Saam hash example
user defined exception
C++17 function traits not works
2574 EC
C++ Register
Set sub sequences.
HTML Timetable generator.cpp
regimeketopdf