Created
January 5, 2022 18:43
-
-
Save ulvimammaadov/4823880890ba6dea0ab11a325b76fbce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAX_HEIGHT 41 | |
struct box | |
{ | |
int length, width, height; | |
}; | |
typedef struct box box; | |
void solution(box *boxes,int n){ | |
for (int i = 0; i < n; i++) | |
{ | |
if (boxes[i].height < MAX_HEIGHT) | |
{ | |
int result = boxes[i].length * boxes[i].width * boxes[i].height; | |
printf("%d\n", result); | |
} | |
} | |
} | |
int main() | |
{ | |
int n; | |
scanf("%d",&n); | |
box *boxes = malloc(n * sizeof(box)); | |
for (int i = 0; i < n; i++) | |
{ | |
scanf("%d%d%d", &boxes[i].length, &boxes[i].width, &boxes[i].height); | |
} | |
solution(boxes,n); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment