TOPIC

Presentation error (5%)

Hector_Tavares07 asked 3 years ago

Não entendi porque está dando Presentation error(5%), se alguem conseguir me ajudar agradeço. codigo abaixo.

import java.util.Scanner; public class Main {

public static void main(String[] args) {
    Scanner teclado = new Scanner(System.in);
    int M,N;    
    do {
        M=teclado.nextInt();
        N=teclado.nextInt();
        int soma=M+N;
        String stringSoma=""+soma;
        String resultado=stringSoma.trim().replaceAll("0","");  
        System.out.println(resultado);
        } while(M != 0 && N!=0);
}

}

Remember not post solutions. Your post may be reviewed by our moderators.

  • PabloPimentel replied 2 years ago

    Não sei o por que está dando 5% de presentation error, segue meu código, se alguém pode me ajudar fico agradecido flag = True

    while flag: try: sequencia = input().split() numero1 = int(sequencia[0]) numero2 = int(sequencia[1]) if numero1 ==0 and numero2==0: flag = False soma = numero1+numero2 soma = str(soma) total = list(soma) separator = "" for x in range(len(total)): if "0" in total: total.remove("0") resultado = separator.join(total) print(resultado) except EOFError: flag = False