Skip to content

Instantly share code, notes, and snippets.

View wagfim's full-sized avatar

Wagner Bonfim wagfim

View GitHub Profile
@wagfim
wagfim / Main.java
Created September 14, 2019 18:05
Copy a stack to another using recursion
public class Main {
public static void main(String[] args) {
Stack newStack = new Stack();
Stack clone = new Stack();
//populate a stack
for (int i = 0; i < 10; i++) {
newStack.push(i);
}
//copy from one stack to another
copyStack(newStack, clone);
@wagfim
wagfim / Main.java
Created October 17, 2019 22:28
Implementação de um jogo Sudoku em java
package br.edu.ifpr;
import java.util.Scanner;
/**
* @author Wagner Bonfim
*/
public class Main {
public static void main(String[] args) {
Scanner leitor = new Scanner(System.in);
int linha = -1, coluna = -1, numeroEscolhido = -1, nivelDificuldade = -1;
boolean keepAsking = true; //garante que os numeros digitados sejam válidos
@wagfim
wagfim / GFG.java
Created November 13, 2019 18:21
Gauss Jordan escalonamento matriz redução java
class GFG {
static int M = 10; //??
// exibe a matriz
static void exibeMatriz(float a[][], int n) {
String vermelhoCiano = "\033[31;46m";
String reset = "\033[0m";
for (int i = 0; i < n; i++) {
for (int j = 0; j <= n; j++) {
@wagfim
wagfim / Main.java
Created November 27, 2019 17:08
Gauss Jordan
import java.util.Scanner;
class Main {
static int M = 10; //??
// funcao principal
public static void main(String[] args) {
Scanner leitor = new Scanner(System.in);
int n = 3, flag = 0;
String pares;
@wagfim
wagfim / Main.java
Created November 27, 2019 20:04
Gauss Jordan Solver
//package gaussjordan;
import java.util.Scanner;
class Main {
static int M = 10; //??
// funcao principal
public static void main(String[] args) {
Scanner leitor = new Scanner(System.in);
int n = 3, flag = 0;