Advertisement
eduardovp97

gg

Sep 3rd, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.65 KB | None | 0 0
  1. program gg;
  2. {Autor: }
  3.  
  4. var alea,dis,v1,p1,v2,p2,v3,p3 :  Real;
  5.   hh,mm,ss,er : Integer;
  6.   v: Real;
  7.   tiempo: Real;
  8.  
  9. begin
  10. readln(dis,v1,p1,v2,p2,v3,p3 );
  11. p1 := trunc(p1*10);
  12. p2 := trunc(p2*10);
  13. p3 := trunc(p3*10);
  14.  
  15. randomize;
  16. alea := random();
  17. alea := 0.3;
  18. alea := trunc(alea*1000);
  19. er:= (trunc(p1)-1);
  20. v:= v1*ord(trunc(alea) in [0..er]) + v2*ord(trunc(alea) in [trunc(p1)..trunc(p1+p2)-1])+
  21.     v3*ord(trunc(alea) in [trunc(p1+p2)..trunc(p1+p2+p3)-1]);
  22. v := v*18/5;
  23. tiempo := dis/v;
  24. hh := trunc(tiempo);
  25. mm := trunc(frac(tiempo))*60;
  26. ss := trunc(frac(frac(tiempo)*60)*60);
  27. writeln('Resultado: ', hh, ' hh ',mm,' mm ',ss,' ss .');
  28.  
  29.  
  30. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement