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:这样写行不行?不过waIn Reply To:这样写行不行?不过wa Posted by:goodpeter at 2007-08-24 17:20:29 > #include <iostream> > #include <map> > using namespace std; > > int P; > int count = 0; > > int main(int argc, char* argv[]) > { > map<int, int> book; > cin>>P; > int index = 0; > while(index < P) > { > int a; > cin>>a; > if(book.find(a) == book.end()) > { > book[a] = a; > count++; > } > index++; > } > > cout<<count<<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