摘要: #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')': ... 阅读全文
posted @ 2012-08-02 16:34 myth_HG 阅读(336) 评论(0) 推荐(0) 编辑
摘要: #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") 阅读全文
posted @ 2012-08-02 14:17 myth_HG 阅读(413) 评论(0) 推荐(0) 编辑