| ||||||||||
| 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:错在何处?请高手指正! Posted by:ibm at 2004-04-25 20:34:20 这里有一个解:
#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