Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
哪位牛人帮我看看啊,怎么老WA啊?#include <iostream> #include <string> using namespace std; int main() { string w[120],m; int i=0,s=0; w[0]="http://www.acm.org/"; while(cin>>m&&m!="QUIT") { if(m=="VISIT") { i++; cin>>w[i]; cout<<w[i]<<endl; s=i; } if(m=="BACK") { i--; if(i>=0) cout<<w[i]<<endl; else { i++; cout<<"Ignored"<<endl; } } if(m=="FORWARD") { i++; if(i<=s) cout<<w[i]<<endl; else cout<<"Ignored"<<endl; } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator