This file contains 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
// @author Carlos Saraiva | |
import java.util.*; | |
public class Somatoria | |
{ | |
public static void main(String args[]) | |
{ | |
double n = 1; | |
double soma = 0; | |
System.out.println("Esse programa fará contém um algoritimo que faz a"); |
This file contains 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
// @author Carlos Saraiva | |
import java.util.*; | |
public class SegundoMaior { | |
public static void main (String args[]) | |
{ | |
int n; // variável usada para determinar o tamanho do vetor, e que será¡ usada para determinar o tamanho do loop | |
int aux; //variável para auxiliar a troca no booble sort. | |
Scanner leitura = new Scanner(System.in); |
This file contains 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
/*Exercício 04 - Busca Linear | |
* Autor: Carlos Saraiva | |
* FATEC, Ipiranga - São Paulo/SP | |
*/ | |
import java.util.*; | |
public class BuscaLinear { | |
public static void main (String args[]){ | |
This file contains 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.*; | |
import javax.swing.text.html.HTMLEditorKit.Parser; | |
public class principal { | |
public static void main (String args[]) | |
{ | |
This file contains 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 teste2 | |
{ | |
public static void main (String args[]) | |
{ | |
double soma = 0; | |
for (int i=0; i < args.length; i++) | |
{ | |
soma = soma + Double.parseDouble( args[i] ); | |
} | |
System.out.println("A soma resulta " + soma); |
This file contains 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
// Algoritimo que gera a sequência de Fibonacci; baseado em sua função matemática: | |
// http://upload.wikimedia.org/math/0/d/5/0d5cce25d67941bb4661afd52609d93c.png (mais detalhes no wikipedia) | |
//Tentei encontrar pela net, mas só achei cuzices, fiz um mais simples (sem chamada de função) para poder entender //melhor a idéia. | |
//Autor: Carlos Eduardo Saraiva | |
public class Fibonacci | |
{ | |
public static void main(String[] args) | |
{ | |
for (int i = 0; i <= 20; i++) |
This file contains 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
//Autor: Carlos Saraiva | |
//Exercícios de PEM, com métodos de soma e multiplicação de matrizes. | |
import java.util.*; | |
public class OperacaoMatrizes | |
{ | |
public static void main(String[] args) | |
{ |
This file contains 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
/*Usei variáveis em inglês para treinar um pouco e também fazer algo que seja legível por qualquer pessoa. | |
No final tem um return -1, porque o eclipse exigia um retorno no final mesmo tendo vários retornos nos durante o método. | |
Mas creio que pode dar alguma idéia de como aplicar recursividade neste caso. Se alguémtiver algum problema me avisa! | |
Ainda não consegui exportar o projeto para que outras pessoas possam testar. */ | |
/*UPDATE: De fato precisei de dois métodos recursivos para escanear a diagonal tanto para diagonal que | |
'sobe a direita ' quanto a que desce a esquerda do botão que foi apertado. | |
Apesar de ter nomeado o método de "INV", ela não é inversa (acabei me confundindo na hora de nomear. | |
Talvez dê para simplificar em um único método, mas procurei modularizar o máximo possível.. Idéia são bem vindas. |
This file contains 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.awt.EventQueue; | |
import java.awt.FlowLayout; | |
import javax.swing.Icon; | |
import javax.swing.JFrame; | |
import javax.swing.JButton; | |
import javax.swing.JOptionPane; | |
import java.awt.BorderLayout; |
This file contains 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
#define readkey | |
using System; | |
namespace m7tr1x | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
OlderNewer