(SPOJ) 11645 - Notas da prova - Solução
import java.io.*;
import java.util.*;
class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
Main processando = new Main();
processando.processa();
System.exit(0);
}
void processa() throws NumberFormatException, IOException {
String line = "";
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
line = br.readLine();
StringTokenizer tokenizer = new StringTokenizer(line);
int nota = Integer.valueOf(tokenizer.nextToken());
if (nota == 0) {
System.out.println("E");
}
else if (nota >= 1 && nota <= 35) {
System.out.println("D");
}
else if (nota >= 36 && nota <= 60) {
System.out.println("C");
}
else if (nota >= 61 && nota <= 85) {
System.out.println("B");
}
else if (nota >= 86 && nota <= 100) {
System.out.println("A");
}
return;
}
}
import java.util.*;
class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
Main processando = new Main();
processando.processa();
System.exit(0);
}
void processa() throws NumberFormatException, IOException {
String line = "";
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
line = br.readLine();
StringTokenizer tokenizer = new StringTokenizer(line);
int nota = Integer.valueOf(tokenizer.nextToken());
if (nota == 0) {
System.out.println("E");
}
else if (nota >= 1 && nota <= 35) {
System.out.println("D");
}
else if (nota >= 36 && nota <= 60) {
System.out.println("C");
}
else if (nota >= 61 && nota <= 85) {
System.out.println("B");
}
else if (nota >= 86 && nota <= 100) {
System.out.println("A");
}
return;
}
}
Comments
Post a Comment