This file contains hidden or 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 <iostream> | |
| using namespace std; | |
| class Numero { | |
| int val; | |
| public: | |
| Numero(int n = 0) : val(n) {} | |
| ~Numero() {} | |
| const Numero operator+(int n) { | |
| return Numero(val); |
This file contains hidden or 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 <iostream> | |
| using namespace std; | |
| class Numero { | |
| int val; | |
| int soma; | |
| public: | |
| Numero(int n = 0, int sum = 0) : val(n), soma(sum) {} | |
| ~Numero() {} | |
| // Cria um novo valor somado, mas com o campo soma nos dizendo |
This file contains hidden or 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 <iostream> | |
| #include <string> | |
| using namespace std; | |
| int subseq(std::string str, std::string pattern) | |
| { | |
| size_t lastpos = 0; | |
| size_t occur = 0; | |
| if (!str.size() || !pattern.size()) { |
This file contains hidden or 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 <iostream> | |
| using namespace std; | |
| #define MAX 5 | |
| int queue[MAX]; | |
| int init = 0; | |
| int final = 0; | |
| int counter = 0; |
This file contains hidden or 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
| // =========================================================================== | |
| // Manipulação algébrica de datas | |
| // Marcos Medeiros | |
| // =========================================================================== | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <ctime> | |
| #include <cstring> | |
| using namespace std; |
This file contains hidden or 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> | |
| #define LOGIN_MAX 64 | |
| #define SENHA_MAX 32 | |
| struct usuario_t { | |
| char login[64]; | |
| char senha[32]; |
This file contains hidden or 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
| /* Avaliador de expressões lógicas | |
| * | |
| * Operadores: | |
| * ¬ = ! (negação) | |
| * /\ = ^ (e) | |
| * \/ = | (ou) | |
| * -> = > (condicional) | |
| * <-> = - (bicondicional) | |
| * | |
| * O fluxo das operações dentro do programa é: |
This file contains hidden or 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 <iostream> | |
| #include <string> | |
| using namespace std; | |
| class hello { | |
| public: | |
| hello& message(string msg) { | |
| cout << msg; | |
| return *this; |
This file contains hidden or 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
| function inserir(t, index, str) { | |
| return t.substring(0, index) + str + t.substring(index, index + t.length); | |
| } | |
| function trocar(t, index, str) { | |
| return t.substr(0, index) + str + t.substr(index+str.length); | |
| } | |
| function validarHora(evt, controle) { | |
| var evento = evt || window.event; | |
| var tecla = evento.keyCode || evento.which; |
This file contains hidden or 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 <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| using namespace std; | |
| template<typename T> | |
| void selection(T &n) | |
| { | |
| for (typename T::iterator it = n.begin(); it != n.end()-1; ++it) { |
OlderNewer