Results 1 to 10 of 10

Thread: Java

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Anybody Killa's Avatar
    Join Date: May:2006
    Location: Sofia
    Posts: 36

    Java

    Java. . , time 10 , 0000, 1000, 2000 9000. 5600 5000 . .

  2. #2
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    , . . . . .
    :
    5600
    5600:1000=5.6
    bottom (5.6)=5
    t[5] - 5000, 5600

    .

  3. #3
    Registered User Anybody Killa's Avatar
    Join Date: May:2006
    Location: Sofia
    Posts: 36


    2 + - / *, a ? b = , case. . : 10 0000, 1000,2000,3000...9000. 5600 5000 . 10

  4. #4

    Join Date: Sep:2005
    Location: Sofia
    Posts: 18,517
    Quote Originally Posted by bsb View Post
    5600
    5600:1000=5.6
    :
    5600/1000=5
    5600.0/1000=5.6
    .

    - 11 . . , 1 . 11 ( 10), , .
    Last edited by vvvlado; 5th December 2008 at 15:53.

  5. #5

    Join Date: Jun:2002
    Location: 85435
    Posts: 4,619
    Java .
    X570 Aorus Elite || R5 3600x || NH-D14 || 32GB RAM || GTX1070Ti Ultra Silent || PCE-AC56 || 850 EVO+MP510+HDDs || SSR-650RT all in Dark Base 900 || EV2736W || G29 || Obutto Ozone+Sparco R333

  6. #6

    Join Date: Sep:2005
    Location: Sofia
    Posts: 18,517
    - . 1/n , . ,

  7. #7
    Registered User Anybody Killa's Avatar
    Join Date: May:2006
    Location: Sofia
    Posts: 36
    , 10 10 , 10
    import java.util.Arrays;
    import java.util.Scanner;
    import static java.lang.Math.*;

    public class test4e
    {
    public static void main(String... args)
    {
    Scanner sc = new Scanner(System.in);

    int j, k, number, size=10;
    boolean found = false;

    int[] intArray = new int[size];

    for (j=0; j<size; j++)
    intArray[j] = (int) (random()*100);

    System.out.print("Guess one of the numbers: ");
    number = sc.nextInt();

    k=0;
    while (!found && k<size)
    if (intArray[k]==number)
    found=true;
    else
    k +=1;

    System.out.println();
    if (found)
    System.out.println("Found in position " + k);
    else
    System.out.println("The number is not found");

    System.out.println("\nThe random array for verification is:\n");
    System.out.println(Arrays.toString(intAr ray));
    }
    }
    [66,7,23,67,88,11,1,4,8,0]
    [0,1,2,3,4,5,6,7,8,9]

  8. #8

    Join Date: Sep:2005
    Location: Sofia
    Posts: 18,517
    Quote Originally Posted by Anybody Killa View Post
    , 10 10 , 10


    [66,7,23,67,88,11,1,4,8,0]
    [0,1,2,3,4,5,6,7,8,9]
    ?
    random 0 1.
    java.util.Random nextInt(int n), , - .
    . , . , 10 10 2, . 9 5. 5- , 6. . .
    100 10 - , .

    Vector , , .
    Last edited by vvvlado; 20th December 2008 at 18:46.

  9. #9
    Registered User Anybody Killa's Avatar
    Join Date: May:2006
    Location: Sofia
    Posts: 36
    , 4345 4000

  10. #10

    Join Date: Sep:2005
    Location: Sofia
    Posts: 18,517
    - .
    4345/1000*1000=4000
    4345/100*100=4300

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |