lundi 5 décembre 2016

how to make the "if" write the number of hundreds in each int?

import java.util.Random;
class adam{
  public static void main(String[]args)
  {
    Random rnd = new Random();
    int first =   rnd.nextInt(900)+100;
    int second =  rnd.nextInt(900)+100;
    int third =  rnd.nextInt(900)+100;

    System.out.println(first);
    System.out.println(second);
    System.out.println(third);

    if ((first==second&&first==third)/100);
    System.out.println(first);
    System.out.println(second);
    System.out.println(third);
  }


}

how to make the "if" write the number of hundreds in each int? for example 124, 357, 653, 1, 3, 6. Thanks! "The operator / is undefined for the argument type(s) boolean, int"

Aucun commentaire:

Enregistrer un commentaire