C

@cleutonsampaio

ParallelAcumulator.java

Java
1 year ago
import java.util.Arrays; import java.util.ArrayList; import java.util.List; public class ParallelAccumulator { public static void main(String[] args) { List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); List<Integer> evenNumbers = new ArrayList<>(); // Using a parallel stream to filter even numbers and add them to evenNumbers

Com ADT

Rust
1 year ago
enum FormaPagamento { AVista, Parcelado { numero_parcelas: i64 }, } impl FormaPagamento { /// Construtor para pagamentos à vista pub fn avista() -> Self { FormaPagamento::AVista

Sem ADT

Rust
1 year ago
struct Pagamento { cliente: String, valor_a_vista: f32, parcelado: bool, numero_parcelas: i64, } fn calcular_valor_parcela(pagamento: &Pagamento) -> f32 { if pagamento.parcelado {

busca_arvore_binaria_DFS

C
2 years ago
#include <stdio.h> #include <stdlib.h> // Definição da estrutura para um nó da árvore struct No { int dado; struct No* esq; struct No* dir; };

inicio.go

Go
4 years ago
package main import ( "fmt" "time" ) func main() { timeNow := time.Now()

string inverter

Python
4 years ago
if __name__=="__main__": nome=input("Informe seu nome: ") print(nome[::-1])

bhaskara

Python
4 years ago
import math def calc_delta(a,b,c): delta = b**2 - 4 * a * c return delta a = float(input("a: ")) b = float(input("b: ")) c = float(input("c: "))

meu_teste_fibonacci

Python
4 years ago
def execute(x): fibonacci = (lambda x, x_1=1, x_2=0: x_2 if x == 0 else fibonacci(x - 1, x_1 + x_2, x_1)) return fibonacci(x) if __name__=='__main__': print(execute(11))

fibonacci1

Python
4 years ago
def execute(x): fibonacci = (lambda x, x_1=1, x_2=0: x_2 if x == 0 else fibonacci(x - 1, x_1 + x_2, x_1)) return fibonacci(x) if __name__=='__main__': print(execute(11))

meu_fibonacci

Python
4 years ago
def execute(x): x = 5 if x<2 or x>15 else x fibonacci = (lambda x, x_1=1, x_2=0: x_2 if x == 0 else fibonacci(x - 1, x_1 + x_2, x_1)) return fibonacci(x) if __name__=='__main__': print(execute(11))

Lambda101-Multiplos-comandos-2

Java
6 years ago
import java.util.*; import java.lang.*; import java.io.*; // Lambda 101: Multiplos comandos /** * Esta eh uma interface funcional, pois possui apenas um metodo abstrato. */ interface Bhaskara {

Lambda101-Funcional-interface-1

Java
6 years ago
import java.util.*; import java.lang.*; import java.io.*; // Lambda 101: Functional interface /** * Esta eh uma interface funcional, pois possui apenas um metodo abstrato. */ interface Bhaskara {