We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bee31d commit 2ed3f9cCopy full SHA for 2ed3f9c
1 file changed
niuke/practice/noob/noob93 【模板】队列操作/1.cpp
@@ -3,14 +3,49 @@
3
#include <vector>
4
using namespace std;
5
6
+template <typename T>
7
+class Queue_e{
8
9
+ queue<T> q;
10
+public:
11
-template
12
+ void push(const T& x){
13
+ q.push(x);
14
+ }
15
+
16
+ void pop(){
17
+ if(!q.empty()){
18
+ q.pop();
19
+ }else{
20
+ cout << "ERR_CANNOT_POP\n";
21
22
23
24
+ void front() const {
25
26
+ cout << q.fornt() << '\n';
27
28
+ cout << "ERR_CANNOT_QUERY\n";
29
30
31
32
+ void size() const {
33
+ cout << q.size() << '\n';
34
35
36
+ bool empty() const {
37
+ return q.empty();
38
39
40
+};
41
42
int main() {
- queue<int> q;
43
+ Queue_e<int> qe;
44
int n;cin>> n;
45
46
+ while(n--){
47
48
49
50
}
51
// 64 位输出请用 printf("%lld")
0 commit comments