MrGluck
Модератор
7719 / 4755 / 728
Регистрация: 29.11.2010
Сообщений: 13,001
|
06.06.2012, 15:36
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| #include <iostream>
#include <queue>
int main()
{
std::queue<int> q;
q.push(1);
q.push(3);
q.push(5);
q.push(6);
q.push(1);
while (!q.empty() && q.front() % 2 == 1)
{
std::cout<< q.front()<< " ";
q.pop();
}
std::cout<< std::endl<< &q.back()<< " "<< &q.front();
return 0;
} |
|
http://liveworkspace.org/code/6544118505b15c24db926c38edf3e283
1
|