1078 - Another Candies

Discussion around the problems of the COJ.
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Post Reply
User avatar
dovier
Posts: 1143
Joined: 7 years ago
Location: Havana, Cuba
Gender: Male
Cuba

1078 - Another Candies

Post by dovier » 7 years ago




JAcKaSS
Posts: 1
Joined: 3 years ago
Gender: None specified

Re: 1078 - Another Candies

Post by JAcKaSS » 3 years ago

Este problema tiene algun defecto?? porque no le encuentro ningun error y me sigue dando runtime error

angelmh
Posts: 11
Joined: 3 years ago
Gender: None specified

Re: 1078 - Another Candies

Post by angelmh » 3 years ago

Este problema solo te confunde a mi entender, solo olvida esas lineas vacias y dale con el codigo, mi codigo fue asi:

import java.util.Scanner;

/**
*
* @author Angel
*/
public class Main {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int cp = Integer.parseInt(s.nextLine());
int cant = 0;
int aux;
long suma = 0;
while (cp-- > 0) {
s.nextLine();
cant = s.nextInt();
aux=cant;
Metodo();

Mostrar();
cant=0;
suma=0;

}
}
}

Post Reply

Return to “Problem set”