fork download
  1. #include<stdio.h>
  2.  
  3. int main() {
  4. float g, j, gus = 1.40, jul = 1.10;
  5. int cont = 0;
  6. scanf("%f %f", &g, &j);
  7. if (g <= j) {
  8. printf("Nunca alcancará");
  9. return 0;
  10. }
  11. g /= 100;
  12. j /= 100;
  13. while (jul <= gus) {
  14. jul += j;
  15. printf("%lf\n", jul);
  16. gus += g;
  17. printf("%lf\n", gus);
  18. cont++;
  19. }
  20. printf("%d", cont);
  21. }
  22.  
  23. //https://pt.stackoverflow.com/q/329729/101
Success #stdin #stdout 0s 9424KB
stdin
8
17
stdout
Nunca alcancará