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 com.gabrielfv.sandbox.triangle; | |
import java.util.Scanner; | |
public class Triangle { | |
/** | |
* Este programa deve "printar" na tela três tipos de triângulos | |
* cujo tamanho é definido pela entrada do usuário. Os tipos de | |
* triângulo sã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
package com.gabrielfv.sandbox.rpn; | |
import java.util.Scanner; | |
import java.util.Stack; | |
/** | |
* Calculadora RPN interativa. | |
* | |
* RPN = Reverse Polish Notation, ou Notação Polonesa Inversa. | |
* (https://pt.wikipedia.org/wiki/Nota%C3%A7%C3%A3o_polonesa_inversa) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/// --- STACK DEFINITION --- | |
typedef struct node_ { | |
int value; | |
struct node_* last; | |
} stack_node_t; |
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
(ns rpn | |
(:require [clojure.edn :as edn])) | |
(deftype Pair [f s]) | |
(defn push' [top value] | |
(Pair. top value)) | |
(defn empty'? [stack] | |
(= stack nil)) |
OlderNewer