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
| puts 'ola mundo' |
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
| class programa{ | |
| public static void main(String args[]){ | |
| System.out.println("Olá mundo"); | |
| } | |
| } |
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 prog{ | |
| public static void main(String [] args){ | |
| double xa,n,eps,xn; | |
| Scanner s = new Scanner(System.in); | |
| xa = s.nextDouble(); | |
| n = s.nextDouble(); | |
| eps = s.nextDouble(); | |
| xn = xa - (xa*xa-n)/(2*xa); |
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
| class exemplo{ | |
| static double atributo1; //atributos da classe | |
| public static void main(Strings args[]){ | |
| //main | |
| } | |
| public static void procedimento(){ | |
| //procedimento | |
| } | |
| } |
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; | |
| } |
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
| 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
| 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
| 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
| 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); | |
OlderNewer