Created
July 7, 2014 16:31
-
-
Save Fhernd/0901a752d9faa934482f to your computer and use it in GitHub Desktop.
Cálculo del cuadrado y el cubo de 11 números enteros.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
// Clase definida por el programador | |
public class CuadradoCubo | |
{ | |
// Método de clase | |
public static void main( String[] args ) | |
{ | |
System.out.printf( "\n Número\tCuadrado\tCubo" ); | |
System.out.printf( "\n %d\t %d\t %d", 0 , ( 0 * 0 ) , ( 0 * 0 * 0 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 1 , ( 1 * 1 ) , ( 1 * 1 * 1 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 2 , ( 2 * 2 ) , ( 2 * 2 * 2 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 3 , ( 3 * 3 ) , ( 3 * 3 * 3 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 4 , ( 4 * 4 ) , ( 4 * 4 * 4 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 5 , ( 5 * 5 ) , ( 5 * 5 * 5 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 6 , ( 6 * 6 ) , ( 6 * 6 * 6 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 7 , ( 7 * 7 ) , ( 7 * 7 * 7 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 8 , ( 8 * 8 ) , ( 8 * 8 * 8 ) ); | |
System.out.printf( "\n %d\t %d\t %d", 9 , ( 9 * 9 ) , ( 9 * 9 * 9 ) ); | |
System.out.printf( "\n %d\t %d\t %d\n", 10 , ( 10 * 10 ) , ( 10 * 10 * 10 ) ); | |
// Salida | |
System.exit(0); | |
} // Fin del método de clase | |
} // Fin de la clase definida por el programador |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment