摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1702View Code 1 #include<iostream> 2 #include<cstring> 3 #include<stack> 4 #include<queue> 5 using namespace std ; 6 int main() 7 { 8 int t, n, x ; 9 string str1, str ;10 cin>>t ;11 while(t--)12 {13 stack<int>s ;14 queue&l 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1022View Code 1 #include<iostream> 2 #include<stack> 3 #include<cstring> 4 using namespace std ; 5 int main() 6 { 7 int n, i, j, k, d[18] ; 8 string a, b ; 9 while(cin>>n>>a>>b)10 {11 i = j = k = 0 ;12 stack<int>s ;1 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1870栈模拟:15MSView Code 1 #include<iostream> 2 #include<stack> 3 #include<cstring> 4 using namespace std ; 5 char a[1005] ; 6 stack<char>s ; 7 int main() 8 { 9 while(cin>>a)10 {11 while(!s.empty())12 s.pop() ;13 int len = strle... 阅读全文
摘要:
http://poj.org/problem?id=1363View Code 1 #include<iostream> 2 #include<stack> 3 using namespace std ; 4 int main() 5 { 6 int a[1005] ; 7 int n ; 8 while(cin>>n,n!=0) 9 {10 while(cin>>a[0],a[0])11 {12 for(int i=1; i<n; i++)13 cin>>a[i] ;14 ... 阅读全文
摘要:
http://poj.org/problem?id=3032View Code 1 #include<iostream> 2 #include<queue> 3 using namespace std ; 4 int main() 5 { 6 int a[14] ; 7 int n, t ; 8 cin>>t; 9 queue<int>q ;10 while(t--)11 {12 cin>>n ;13 q.push(n) ;14 for(int i=n-1; i>=1; i--)15 ... 阅读全文