?? main.cpp
字號(hào):
#include <iostream>#include <vector>#include <string>
using namespace std;
int main()
{ string current = "http://www.acm.org/"; vector<string> back_history(0); vector<string> forw_history(0);
string line; cin>>line; while(line!="QUIT"){ if(line == "VISIT"){ cin>>line; back_history.push_back(current); forw_history.clear(); current = line; cout<<current<<endl; }else if(line == "BACK"){ if(back_history.size()==0){ cout<<"Ignored"<<endl; }else{ line = back_history.back(); back_history.pop_back(); forw_history.push_back(current); current = line; cout<<current<<endl; } }else if(line == "FORWARD"){ if(forw_history.size()==0){ cout<<"Ignored"<<endl; }else{ line = forw_history.back(); forw_history.pop_back(); back_history.push_back(current); current = line; cout<<current<<endl; } } cin>>line; }
return 0;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -