fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdlib.h>
  4. float f,x,a,b,c,k,dx;
  5. int main()
  6. {
  7. printf("x,a,b,c,k,dx \n");
  8. scanf ("%d %d %d %d %d %d",&x,&a,&b,&c,&k,&dx);
  9. while ((x<=k) && (c!=0))
  10. {
  11. if ((x<0)&&(b!=0))
  12. f=-(a*pow(x,2))+b;
  13. else
  14. if ((x>0) && (b=0))
  15. f=(x/(x-c))+5.5;
  16. else
  17. f=x/(-c);
  18. x+=dx;
  19. printf("%.3f\n",f);
  20. }
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 4424KB
stdin
Standard input is empty
stdout
x,a,b,c,k,dx