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.ArrayList; | |
import java.util.List; | |
public class ParallelStreamDemo { | |
public static void main(String[] args) { | |
long t1, t2; | |
List<Employee> eList = new ArrayList<Employee>(); | |
for(int i=0; i<100; 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
.PHONY: run | |
file := $(shell ls -Rt | grep \.poti | head -n1) | |
run: | |
@java -jar potigol.jar -c -w $(file) | |
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
var saida = java.lang.System.out; | |
var n = -3; | |
if (n>0) | |
if (n<10) | |
saida.println("A"); | |
else | |
saida.println("B"); |
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
fizz(numero: Inteiro) = escolha numero | |
caso n se n mod 3 == 0 => "fizz" | |
caso _ => "{numero}" | |
fim | |
buzz(numero: Inteiro) = escolha numero | |
caso n se n mod 5 == 0 => "buzz" | |
caso _ => "{numero}" | |
fim |
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
a, b, c = input().split() | |
a = int(a) | |
b = int(b) | |
c = int(c) | |
if a==b or a==c or b==c: | |
print("S") | |
elif a+b==c or a+c==b or b+c==a: | |
print("S") | |
else: | |
print("N") |
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
package controllers; | |
import play.mvc.*; | |
/** | |
* This controller contains an action to handle HTTP requests | |
* to the application's home page. | |
*/ | |
public class HomeController extends Controller { |
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
n = int(input("Digite um numero: ")) | |
if n % 5 == 0: | |
print(n, "é multiplo de 5.") | |
else: | |
print(n, "não é multiplo de 5.") | |
print("fim") |
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
a = 3 | |
b = 4 | |
c = 5 | |
escreva "Escolha um valor para X" | |
escreva "a, b, c" | |
x = leia_texto | |
xis = escolha x | |
caso "a" => a | |
caso "b" => b | |
caso _ => c |
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
tentativa(palpites: Lista[Inteiro], número: Inteiro, saida: Lista[Texto]): Lista[Texto] | |
palpite = palpites.cabeça | |
se palpite <> número então | |
resp = se palpite < número então | |
"O número é maior do que {palpite}." | |
senão | |
"O número é menor do que {palpite}." | |
fim | |
tentativa(palpites.cauda, número, saida + [resp]) | |
senão |
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
M = input() | |
M1, M2, M3 = int(M[-3]),int(M[-2]),int(M[-1]) | |
M1M3=M1*10+M3 | |
M1M2=M1*10+M2 | |
M2M3=M2*10+M3 | |
M2M1=M2*10+M1 | |
M3M1=M3*10+M1 | |
M3M2=M3*10+M2 | |
print(M1, M2, M3) |