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呢,请教一下高手#include<iostream> using namespace std; int main() { int a[1000][16],i=0,j=0,k=0,m=0,sum[1000]={0},temp1; while( cin>>temp1 && temp1!=-1) { if(temp1==0) { i++; j=0; a[i][j]=11111; continue; } a[i][j]=temp1; j++; } for(j = 0;j < i;j++) for(k = 0;k <16;k++) for(m=k;m<16;m++) { if(a[j][k]==11111) break; if(a[j][k]/a[j][m]==2 && a[j][k]%a[j][m]==0 ||a[j][m]/a[j][k]==2 && a[j][m]%a[j][k]==0) sum[j]++; } for(j = 0;j < i;j++){ cout<<sum[j]<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator