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 |
Re:哪位牛人帮我看看啊,怎么老WA啊?In Reply To:哪位牛人帮我看看啊,怎么老WA啊? Posted by:0710321109 at 2009-02-24 23:16:14 这样…… #include < iostream > #include < string > using namespace std ; int main ( ) { string order , url[100] ; url[0] = "http://www.acm.org/" ; cin >> order ; for ( int i = 0 , j = 0 ; order != "QUIT" ; cin >> order ) { if ( order == "VISIT" ) { i++ ; j = i ; cin >> url[i] ; cout << url[i] << endl ; } if ( order == "BACK" && i - 1 >= 0 ) { i-- ; cout << url[i] << endl ; continue ; } if ( order == "BACK" && i <= 0 ) { cout << "Ignored" << endl ; } if ( order == "FORWARD" && i + 1 <= j ) { i++ ; cout << url[i] << endl ; continue ; } if ( order == "FORWARD" && i >= j ) { 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