Advertisement
Guest User

Untitled

a guest
Nov 11th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. float randomInt(int min, int max) {
  6. return rand() % (max + 1) + min;
  7. }
  8.  
  9. int main() {
  10. srand(time(NULL));
  11.  
  12. float a, b, c;
  13. float x, y, z;
  14.  
  15. scanf("%f %f %f", &a, &b, &c);
  16.  
  17. /* a = 97/100*a;
  18. b = 97/100*b;
  19. c = 97/100*c; */
  20.  
  21. x = 0;
  22. y = 0;
  23. z = 0;
  24.  
  25. while (!(a*x > x + y + z &&
  26. b*y > x + y + z &&
  27. c*z > x + y + z)) {
  28. x = randomInt(1, 25);
  29. y = randomInt(1, 25);
  30. z = randomInt(1, 25);
  31. }
  32.  
  33. printf("x: %f, y: %f, z: %f\n", x, y, z);
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement