while running: clock.tick(30) pole_surf=pygame.image.load('pole.png') pole_surf=pygame.transform.scale(pole_surf,(460,320)) pole_rect=pole_surf.get_rect(center=(230,160)) screen.blit(pole_surf,pole_rect) pygame.display.flip() for event in pygame.event.get(): if event.type==pygame.QUIT: running=False elif event.type==pygame.MOUSEMOTION: paddle.rect.centerx=event.pos[0]
if pygame.sprite.spritecollide(paddle, ballGroup, False): myBall.speed[1]=-myBall.speed[1] pygame.display.flip()
myBall.move() if not done: screen.blit(myBall.image, myBall.rect) screen.blit(paddle.image, paddle.rect) screen.blit(score_surf, score_pos) pygame.display.flip() for i in range (lives): width=screen.get_width() screen.blit(myBall.image, [width - 40*i, 20]) pygame.display.flip() pygame.display.flip()
begin
var a:=ArrRandom(100,-10,10);
a.Println;
Writeln(a.Where(x->x>0).Count,' положительных, ',
a.Where(x->x<0).Count,' отрицательных')
end.
Тестовое решение:
4 -6 0 8 2 -2 -1 -8 -6 8 -3 7 4 -7 -5 9 0 -3 -7 1 0 -4 6 3 8 -10 4 9 3 5 8 5 5 8 10 4 -8 3 8 8 -9 2 7 -8 -7 -5 2 -9 0 9 -7 7 -2 -6 7 -2 -1 7 -10 2 4 1 -1 0 10 3 -8 6 -6 2 6 7 -1 -4 -1 8 0 3 0 2 -2 2 -1 5 1 -9 -4 1 -9 1 -6 -5 3 -4 -7 1 -7 -3 -7 1
51 положительных, 42 отрицательных