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 |
你的输入。。。In Reply To:请高手看看我的代码,为什么wa?? Posted by:w57w57w57 at 2008-12-08 22:04:44 > #include<iostream> > #include<memory> > using namespace std; > main() > { > int tag[101]; > int number; > memset(tag,0,101); > while(cin>>number,number!=-1) > { > if(0==number) > { > int ans = 0; > for(int i=1;i<=50;i++) > { > if(tag[i]==1&&tag[2*i]==1) > { > ans++; > } > } > cout<<ans<<endl; > memset(tag,0,101); > } > else > { > tag[number] = 1; > } > } > //system("pause"); > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator