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 |
help!!!!!#include<iostream.h> void main() { int i,j,a[15]; int num=0,n=0; for(i=0;i<15;i++) { cin>>a[i]; if(a[i]==0||a[i]==-1) break; n++; } while(a[0]!=-1) { for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if((a[i]==2*a[j])||(2*a[i]==a[j])) num++; } } cout<<num<<endl; num=0; n=0; for(i=0;i<15;i++) { cin>>a[i]; if(a[i]==0||a[i]==-1) break; n++; } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator