fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. float speed, bremsw, pathway, anhaltsw; // Deklaration der noetigen Variablen
  6.  
  7.  
  8. printf("\n\n Geben Sie Ihre voraussichtliche Geschwindigkeit(km/h) ein:");
  9. scanf("%f", &speed);
  10.  
  11. pathway = ( speed / 10 ) * 3;
  12. bremsw = ( speed / 10 ) * ( speed / 10 );
  13. anhaltsw = pathway + bremsw;
  14.  
  15. system("cls");
  16. printf("\n\n Reaktionsweg: %fm\n\n Bremsweg: %fm\n\n Anhalteweg: %fm", pathway, bremsw, anhaltsw);
  17.  
  18. system("pause");
  19. return 0;
  20. }
Success #stdin #stdout #stderr 0s 2160KB
stdin
Standard input is empty
stdout

  Geben Sie Ihre voraussichtliche Geschwindigkeit(km/h) ein:

  Reaktionsweg: -0.000004m

  Bremsweg: 0.000000m

  Anhalteweg: -0.000004m
stderr
sh: 1: cls: not found
sh: 1: pause: not found