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 javax.swing.*; | |
| public class rand { | |
| public static void main(String[] args) { | |
| //Xf=(a*Xi+b)%m; | |
| double a = 752395; | |
| double Xi; | |
| double m = 254; | |
| double b = 25; | |
| double Xf; |
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 javax.swing.*; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| public class rand { | |
| public static void main(String[] args) { | |
| //Xf=(a*Xi+b)%m; | |
| double a = 752395; | |
| double Xi; |
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 javax.swing.*; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| public class rand { | |
| public static void main(String[] args) { | |
| //Xf=(a*Xi+b)%m; | |
| double a = 25136; | |
| double Xi; |
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 javax.swing.*; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| public class randd { | |
| public static void main(String []args){ | |
| double seed,Xi,Xf; | |
| double[] vetor; | |
| int t; |
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 javax.swing.JOptionPane; | |
| public class Vetores2 { | |
| public static void main(String[] args) { | |
| int a[] = {3, 10, 4, 2, 8}; | |
| int[] b = {10, 4, 12, 3, 23, 1, 8}; | |
| int[] c = new int[(int)Math.min(a.length, b.length)]; | |
| int i=0; | |
| for(int f=0;f<a.length;f++){ | |
| for(int k=0;k<b.length;k++){ |
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 javax.swing.*; | |
| class prog{ | |
| public static void main(String args[]){ | |
| int[] v1; | |
| int[] v2; | |
| int tamanho; | |
| do{ | |
| tamanho = Integer.parseInt(JOptionPane.showInputDialog("Entre com o tamanho do vetor 1")); |
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.*; | |
| class matriz{ | |
| public static void main(String[] args){ | |
| Scanner s = new Scanner(System.in);//Scanner inicializado em s | |
| int[] vetor;//Vetor principal | |
| String[] entrada;//Vetor de entrada | |
| entrada = s.nextLine().split(" ");//Reparte a entrada e coloca no vetor de entrada separando por espaços. | |
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 javax.swing.*; | |
| public class coord { | |
| //Xf=(a*Xi+b)%m; | |
| public static double seed = 1; | |
| public static double a = 179424361; | |
| public static double b = 11; | |
| public static double m = 1000000000; | |
| public static double dNom = 100000; | |
| public static double[][] matriz; | |
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 javax.swing.*; | |
| public class juncao { | |
| public static void main(String [] args){ | |
| int[] vetA; | |
| int[] vetB; | |
| int[] vetC; | |
| int tamVetor = -1; | |
| do{ |
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 int[] merge(Comparable[] arg1, Comparable[] arg2) | |
| { | |
| //convert arrays to collections (lists) | |
| Collection coll1 = Arrays.asList(arg1); | |
| Collection coll2 = Arrays.asList(arg2); | |
| //Create a SortedSet from the first collection | |
| SortedSet sorter = new TreeSet(coll1); | |
| //Add the second collection |