(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);
    }
}

Comments

Popular posts from this blog

(Coderbyte) Dash Insert II - Solução

(Coderbyte) Run Length - Solução

(Coderbyte) Counting Minutes I - Solução