fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a,b,c,i,z;
  5. float x,w;
  6. for(i=0;i<10;i++) {
  7. scanf("%i %i %i %f",&a,&b,&c,&x);
  8. w = a*x*x + b*x + c;
  9. z = (int) w;
  10. if(w==z)
  11. {
  12. printf("%.f \n", w);
  13. }
  14. else{
  15. printf("%f \n",w);
  16. }
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 4528KB
stdin
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4.5
stdout
27 
27 
27 
27 
27 
27 
32.250000 
32.250000 
32.250000 
32.250000