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.*; | |
| 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 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.*; | |
| 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.*; | |
| class vetores{ | |
| public static void main(String [] args){ | |
| int[] vetor; | |
| int tamanho,x,iPosicao; | |
| do{ | |
| tamanho = Integer.parseInt(JOptionPane.showInputDialog("Entre com o tamanho do vetor")); | |
| }while(tamanho<=0); | |
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 maior{ | |
| public static void main(String args[]){ | |
| int a,b; | |
| a = Integer.parseInt(JOptionPane.showInputDialog("Entre com o 1° número")); | |
| b = Integer.parseInt(JOptionPane.showInputDialog("Entre com o 2° número")); | |
| JOptionPane.showMessageDialog(null,"O maior dentre os 2 é: "+devmaior(a,b)); | |
| } | |
| public static int devmaior(int a, int b){ |
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 int mdc( int x, int y ){ | |
| if(x == y){ | |
| return x; | |
| } | |
| else if( y > x ){ | |
| return mdc( x, y-x ); | |
| } | |
| else if( x > y ){ | |
| return mdc( x - y, y ); | |
| } |
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
| clss fatorial{ | |
| public static void main(String args[]){ | |
| System.out.println(fat(10)); | |
| } | |
| public static double fat(double n){ | |
| n==0?1:n*fat(n-1); | |
| return 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 javax.swing.*; | |
| import java.lang.*; | |
| class seno{ | |
| public static void main(String args[]){ | |
| double x, soma=0,fat,xgraus; | |
| int n; | |
| x = Double.parseDouble(JOptionPane.showInputDialog("Insira o angulo (em graus)")); |
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 calculadora { | |
| static double x,y,resultado; | |
| static int opcao; | |
| public static void soma(){ | |
| resultado = x+y; | |
| } |