-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9fc74e
commit 5f0f44e
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
typedef struct | ||
{ | ||
int a, b; | ||
} Square; | ||
|
||
int area(Square *square) | ||
{ | ||
return square->a * square->b; | ||
} | ||
int maxBuilds(Square *s, int areaHouse) | ||
{ | ||
int builds = area(s) *100; | ||
return pow(builds /areaHouse, .5); | ||
} | ||
int main(int argc, char const *argv[]) | ||
{ | ||
Square square = {0, 0}; | ||
int a, b, c = -1; | ||
|
||
while (scanf("%d", &a) && a != 0) | ||
{ | ||
scanf("%d %d", &b, &c); | ||
square.a = a; | ||
square.b = b; | ||
|
||
printf("%d\n", maxBuilds(&square, c)); | ||
} | ||
|
||
return 0; | ||
} |