摘要:
#include<iostream>#include<stack>using namespace std;void BracketMatch(char *str){ stack<char> S; char ch; int i; for(i=0;str[i]!='\0';i++) { switch(str[i]) { case'(': case'[': case'{': S.push(str[i]); break; case')': ... 阅读全文
摘要:
#include<iostream>#include<stack>using namespace std;void Conversion (int N){ int x; stack<int> s; if(N==0) { printf("%d\n",0); return ; } while(N>0) { x=N%2; s.push(x); N=N/2; } while(!s.empty()) { x=s.top(); printf("%d",x); s.pop(); } printf("\n") 阅读全文