This file contains hidden or 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 os | |
| # Se introduce la ruta para la creacion del diccionario por teclado | |
| route = input("Introduce la ruta donde se creará el diccionario:") | |
| # la funcion open acepta la ruta donde se va a crear el archivo | |
| # y la W otorga permisos de escritura | |
| file = open(route+"/dictionary.txt", "w") | |
| # la funcion write rellena el contenido del archivo dictinary.txt |
This file contains hidden or 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; | |
| public class Contador{ | |
| public static void main(String[] args) | |
| { | |
| Scanner sc = new Scanner(System.in); | |
| int cont=0, num=0, suma=0, longitud=0, input; | |
| System.out.println("Introduce un numero:"); | |
| input = sc.nextInt(); |
This file contains hidden or 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.*; | |
| public class CalcularAreas { | |
| public static void main(String[] args) { | |
| Scanner input = new Scanner(System.in); | |
| double respuesta, area, base, altura, radio, apotema, lado, pi=3.14; | |
| int reply; | |
| do{ | |
| System.out.println("\n#########################"); |
This file contains hidden or 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.*; | |
| public class Coc { | |
| public static void main(String[] args) { | |
| Scanner input = new Scanner(System.in); | |
| String tropa, hecho; | |
| int total, cantidad; | |
| String[] tropas = {"Barbaro","Arquera","Gigante","Mago","Dragón","Pekka","Esqueleto","Goblin","Globo","Sanadora"}; | |
| int[] costes = {200,400,3000,3500,33000,36000,3000,100,3500,10000}; |
NewerOlder