(URI) Quadrado de Pares - Solução
import java.io.*;
class Main {
public void processa() throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int number = Integer.parseInt(br.readLine());
for (int i = 2; i <= number; i+=2) {
System.out.println(i + "^2 = " + (i*i));
}
return;
}
public static void main(String[] args) throws NumberFormatException, IOException {
Main processando = new Main();
processando.processa();
System.exit(0);
}
}
class Main {
public void processa() throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int number = Integer.parseInt(br.readLine());
for (int i = 2; i <= number; i+=2) {
System.out.println(i + "^2 = " + (i*i));
}
return;
}
public static void main(String[] args) throws NumberFormatException, IOException {
Main processando = new Main();
processando.processa();
System.exit(0);
}
}
Comments
Post a Comment