-
Notifications
You must be signed in to change notification settings - Fork 0
/
function.h
53 lines (44 loc) · 1.12 KB
/
function.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "function.h"
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
//freopen("test/1.in","r",stdin);
#endif // ONLINE_JUDGE
Implement inst = *(new Implement());
string command;
int data , data_ref;
while(cin>>command){
if(command == "InsertBack"){
cin>>data;
inst.InsertBack(data);
}else if(command == "InsertFront"){
cin>>data;
inst.InsertFront(data);
}else if(command == "InsertAfter"){
cin>>data>>data_ref;
inst.InsertAfter(data , data_ref);
}else if(command == "InsertBefore"){
cin>>data>>data_ref;
inst.InsertBefore(data , data_ref);
}else if(command == "Delete"){
cin>>data;
inst.Delete(data);
}else if(command == "DeleteFront"){
inst.DeleteFront();
}else if(command == "DeleteBack"){
inst.DeleteBack();
}else if(command == "Reverse"){
inst.Reverse();
}else if(command == "Rotate"){
int k;
cin>>k;
inst.Rotate(k);
}else if(command == "PrintChain"){
cout<<inst.PrintChain()<<endl;
}
}
return 0;
}