Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C++ Title: Matchbox (item 1 2 of Zhongshan Primary School Informatics Invitational Tournament)
C++ Title: Matchbox (item 1 2 of Zhongshan Primary School Informatics Invitational Tournament)
# include & ltstdio.h & gt

# include & ltiostream & gt

# include & ltmath.h & gt

int main(){

int N,L,W,I,sum=0,sqr = 0;

//printf ("Please enter how many sets of test data:"); North, west and west

scanf("%d%d%d ",& ampn & amp; l & amp; w);

sqr =(int)sqrt(L * L+W * W); //diagonal

int N[N];

//printf ("\ nPlease enter an even number: \ n");

for(I = 0; I & ltn;; i++){

scanf("%d ",& ampn[I]);

if(n[I]& lt; = sqr){// Not greater than diagonal

sum++;

}

}

printf("%d ",sum); //Total

System ("suspended");

Returns 0;

}