Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement