| ||||||||||
| 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:Re:向清华致敬.......同敬... Posted by:winsweet at 2008-12-16 16:25:01 #include<iostream.h>
void main()
{
while(1)
{
int r1[17],r2[17],k,i=1,j=0,count=0;
cin>>r1[0];
if(r1[0]==-1)
break;
r2[0]=2*r1[0];
while (cin>>r1[i]&&r1[i]!=0)
{
r2[i]=2*r1[i];
i++;
}
k=i;
for(i=0;i<k;i++)
for(j=0;j<k;j++)
if(r2[j]==r1[i])
count++;
cout<<count<<endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator