Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- float randomInt(int min, int max) {
- return rand() % (max + 1) + min;
- }
- int main() {
- srand(time(NULL));
- float a, b, c;
- float x, y, z;
- scanf("%f %f %f", &a, &b, &c);
- /* a = 97/100*a;
- b = 97/100*b;
- c = 97/100*c; */
- x = 0;
- y = 0;
- z = 0;
- while (!(a*x > x + y + z &&
- b*y > x + y + z &&
- c*z > x + y + z)) {
- x = randomInt(1, 25);
- y = randomInt(1, 25);
- z = randomInt(1, 25);
- }
- printf("x: %f, y: %f, z: %f\n", x, y, z);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement