fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. for(int i = 0;i<100 ;i ++) {
  13. System.out.println(String.valueOf(getRandom(1.1, 2.5)));
  14. }
  15. }
  16.  
  17. public static double getRandom(Double valorMinimo, Double valorMaximo) {
  18. Random rand = new Random();
  19. return valorMinimo + ( valorMaximo - valorMinimo ) * rand.nextDouble();
  20. }
  21. }
Success #stdin #stdout 0.11s 321088KB
stdin
Standard input is empty
stdout
2.112371842708471
2.0761604279842443
1.763419185450553
1.1620669902263154
2.139203595268264
1.4362951758984244
1.6987188668225608
1.178160313308143
2.2613598604056833
2.4224087318762955
2.370497108629311
1.761657364401147
2.4378250517730597
1.6128979344633159
1.4738870334560883
2.402349209339536
1.259811517718356
1.74743028710481
1.9414393894959994
1.7050410588257605
1.3771933367334106
1.3631218525445141
1.8836884983499793
2.4388686032356572
2.22462457100589
1.5076622331947809
1.2807104010236032
1.29881621180937
1.287625420917902
1.493588919557194
2.114297075415175
1.118610518496012
1.2122551318498362
1.5354638685659299
2.1690859079720815
1.8364177184363353
1.6434986176737172
2.311753631408878
1.621110436058471
2.058706634170228
1.309417028499367
2.063126272560969
2.383236191080064
1.3265665556265671
2.0680253888452804
2.312680257252981
1.2049286733129678
1.245857098693341
1.2735224498487638
1.9596410993125462
1.502083639473359
1.32246214776294
2.073785523457678
2.4400415949770706
1.4853590856267762
2.482970025178047
1.1085159415014825
2.027410786498765
1.2050363948296878
1.1149777267547283
1.1137635635881098
1.100037056963421
2.2786793865243773
1.6848392070754166
1.1738066639825528
1.8840694453446534
1.5222779871197865
1.7427533579047587
1.3307971118179345
1.9583628466463519
1.7996964788081207
2.1642171168995334
1.135835964128306
1.1333813574554243
1.6047221825900415
1.3386751073364245
1.4636908861902689
1.9945097589625291
1.2683314552959457
2.427424085438971
2.199240887724433
2.4590424254242724
1.6350775979270336
1.9060123618542484
2.3168960792527398
1.167030713226878
2.0430906038307457
1.920167787184599
1.723019068040268
2.3138351983956427
1.4309040230176344
1.6148962822010804
1.4289202611969134
1.4633492316149086
1.460802195000217
1.3534936817299326
1.262554180100076
1.2900140603843246
1.9403078800812597
1.5017787344666558