karlangadas

ocurrencia

Sep 3rd, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.55 KB | None | 0 0
  1. program gg;
  2. {Autor: }
  3.  
  4. var dist, v1, v2,v3,p1,p2,p3:Real;
  5.   ocurrencia, velocidad, tiempo:Real;
  6.   hh,mm,ss:Real;
  7.  
  8. begin
  9. randomize;
  10. read(dist, v1, p1,v2,p2,v3,p3);
  11. ocurrencia:=random(101);
  12. ocurrencia:=30;
  13. velocidad:=v1*ord(ocurrencia<=p1)+v2*ord((ocurrencia<=(p1+p2))and(ocurrencia>p1))
  14. +v3*ord(ocurrencia>(p1+p2+p3));
  15. velocidad:=velocidad*18/5;
  16. tiempo:=dist/velocidad;
  17. hh:=trunc(tiempo);
  18. mm:=(frac(tiempo))*60;
  19. ss:=(frac(mm))*60;
  20. mm:=trunc(mm);
  21. ss:=round(ss);
  22. writeln('Tiempo: ',hh:2:0,'h ',mm:2:0,'m ',ss:2:0,'s ');
  23. readln;
  24. readln
  25. end.
Advertisement
Add Comment
Please, Sign In to add comment