| ||||||||||
| 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:你在仔细读一下题目,这里有一个解In Reply To:你在仔细读一下题目 Posted by:zby03 at 2004-10-17 18:03:54 > 这里有一个解:
> #include<iostream.h>
>
> int main()
> {
> int arr[16];
> cin>>arr[0];
> while(arr[0]!=-1)
> {
> int count=0;
> int ind=1;
> cin>>arr[ind];
> while(arr[ind]!=0)
> {
> ind++;
> cin>>arr[ind];
> }
> for(int i=0;i<ind;i++)
> {
> for(int j=0;j<ind;j++)
> {
> if(arr[i]==2*arr[j])
> count++;
> }
> }
> cout<<count<<endl;
> cin>>arr[0];
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator