TOPIC
Wrong answer (10%) java
epvfilho asked 6 years ago
Não sei noque estou errando ou o que esta faltando vai o codigo
import java.io.IOException;
import java.util.Scanner; public class Main {
public static void main(String[] args) throws IOException {
Scanner entrada = new Scanner (System.in);
int N = entrada.nextInt();
String vetor[] = new String[N];
if (N==0) {
System.out.println("\n");
}else {
for (int i = 0; i < N; i++) {
int preto = 0;
String posicao = "*";
int A = entrada.nextInt();
int B = entrada.nextInt();
int C = entrada.nextInt();
int D = entrada.nextInt();
int E = entrada.nextInt();
if (A<=127) {
preto = preto +1;
posicao = "A";
}
if (B<=127) {
preto = preto +1;
posicao = "B";
}
if (C<=127) {
preto = preto +1;
posicao = "C";
}
if (D<=127) {
preto = preto +1;
posicao = "D";
}
if (E<=127) {
preto = preto +1;
posicao = "E";
}
if (preto == 1) {
vetor[i]=posicao;
}else {
vetor[i]="*";
}
}
for (int i = 0; i < vetor.length; i++) {
System.out.println(vetor[i]+"\n");
}
}
}
}
This topic has not been answered yet. Be the first!