fork download
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main(){
  4. int a,b,c;
  5. scanf("%d %d %d", &a, &b , &c);
  6. if (a==0){
  7. if (b==0){
  8. if (c==0){
  9. printf("VO SO NGHIEM");}
  10. else {
  11. printf("VO NGHIEM");}
  12. }
  13. else {
  14. printf("%.2f\n", -(float)c/b);}
  15. }
  16. else {
  17. float denta;
  18. denta= b*b - 4*a*c;
  19. if (denta < 0) {
  20. printf("VO NGHIEM");}
  21. else if ( denta == 0){
  22. printf("%.2f\n", - (float) b/(2*a));}
  23. else {
  24. float x1, x2;
  25. x1 = ( -b + sqrt(denta)) / (2 * a);
  26. x2 = ( -b - sqrt(denta)) / (2 * a);
  27. printf("%.2f %.2f\n", x1,x2);}
  28. }
  29. return 0;
  30. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
VO NGHIEM