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.ArrayList; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
public class Contact { | |
private int dni; | |
private String name; | |
private String phone; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="css/bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="css/login.css"> | |
<title>Chang</title> | |
</head> | |
<body> | |
<div class="container"> |
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
/* | |
* Program.java 1.0 11-02-2016 | |
* | |
* Copyright 2016 Charly Koch Busquets <[email protected]> | |
* | |
* This is free software, licensed under the GNU General Public License v3. | |
* See http://www.gnu.org/licenses/gpl.html for more information. | |
*/ | |
package game; | |
public class Player { |
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
public class Cotxe { | |
public static void main (String args[]) { | |
Cotxe c = new Cotxe("Seat"); | |
c.setVelocitat(150); | |
System.out.println(c); | |
} | |
public final static float MAX_SPEED = 130; | |
private String marca; |
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.Arrays; | |
public class Program { | |
public static void main (String args[]) { | |
int[][] o = new int[][]{ | |
{ 1, 20, 10 }, | |
{ 6, 3, 18 } | |
}; | |
int[][] d = new int[o[0].length][o.length]; |
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.Random; | |
public class Program { | |
public static void main (String args[]) { | |
int[] arr = rndArrInt(100000, -1000, 1000); | |
System.out.println("------------------------------"); | |
System.out.println("Solució frequent Alex v1: "); | |
long startTime = System.nanoTime(); | |
System.out.println(frequentv1(arr)); |
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.Random; | |
public class Program { | |
public static void main (String args[]) { | |
int[] arr = rndArrInt(100000, -100, 100); // Retorna un array de llargaria 100000 amb nombres aleatoris de -100 a 100 | |
System.out.println(frequent(arr)); | |
} | |
public static int[] rndArrInt (int llarg, int min, int max) { | |
Random rand = new Random(); | |
int[] arr = new int[llarg]; |
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
/* | |
* Program.java 1.0 {date} | |
* | |
* Copyright {year} Charly Koch Busquets <[email protected]> | |
* | |
* This is free software, licensed under the GNU General Public License v3. | |
* See http://www.gnu.org/licenses/gpl.html for more information. | |
*/ | |
public class Program { |
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
public static String figuraSensePrint(int n1,int n2){ | |
String s=""; // amb StringBuffer o StringBuilder millor | |
s="\n\nFigura "+n1+" "+n2+":\n\n"; | |
for (int i=0;i<n1;i++){ | |
s+="@\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
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(123456789)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(123)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(1234)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(12345)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(1233)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(12334)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(12345561)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(1234556123)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(12)); | |
System.out.println(!conteUnaSerieCapicuaDeLlargadaAlMenys3(1)); |