JavaScript is required to use Bungie.net

Servicio de alertas
Mañana, Destiny 2 estará fuera de línea temporalmente debido a operaciones programadas de mantenimiento. Haz clic aquí para ver el estado de los servidores y actualizaciones de Destiny.

Varios

Navega una corriente de discusiones aleatorias.
2/20/2013 1:22:02 AM
4

Help with a simple Computer Science program.

[quote]import java.util.Scanner; public class Project4 { public static void main (String[] args) { int count; int i = 0; Scanner scan = new Scanner(System.in); System.out.print (" Please input a number to be shown the factors: "); count = scan.nextInt(); do{ i++; if(count%i == 0) System.out.println("The factors are: " + i); }while(i <= count); } }[/quote] That is my program and I just need someone to explain how to make all the solutions show up on one line without reiterating the "The factors are" line multiple times. Thanks.

Publicando en idioma:

 

Pórtate bien. Echa un vistazo a nuestro Código de conducta antes de publicar tu mensaje. Cancelar Editar Crear escuadra Publicar

No se te permite acceder a este contenido.
;
preload icon
preload icon
preload icon