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
// Definimos o pino do nosso LED conforme o circuito apresentado | |
#define LED 8 | |
void setup() | |
{ | |
// Setamos nosso pino para enviar informacoes, permitindo ligar e desligar o LED | |
pinMode(LED, OUTPUT); | |
} | |
void loop() |
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
#define a 12 | |
void setup() | |
{ | |
} |
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
// "#define" para definir os pinos de cada led | |
#define vermelho 12 | |
#define amarelo 11 | |
#define verde 10 | |
void setup() | |
{ | |
// seta todos os leds como OUTPUT para poder emitir a cor | |
pinMode(vermelho, OUTPUT); |
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 <iostream> | |
#include <queue> | |
using namespace std; | |
int main() | |
{ | |
queue<int> fila; | |
int 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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main() | |
{ | |
vector<int> V; | |
V.push_back(1); |
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
vector<int> I; | |
I.push_back(10); | |
I.push_back(17); | |
I.push_back(0); | |
I.push_back(-15); | |
cout << I.size() << "\n"; | |
// imprime o tamanho de I, no caso 4 | |
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
vector<int> I; | |
I.push_back(10); | |
I.push_back(17); | |
I.push_back(0); | |
I.push_back(-15); | |
for(int i = 0; i < I.size() ; i++) | |
{ | |
// seu código |
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
vector<int> I; | |
I.push_back(10); | |
I.push_back(17); | |
I.push_back(0); | |
I.push_back(-15); | |
cout << I.back() << "\n"; | |
// imprime -15 | |
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
vector<int> I; | |
I.push_back(10); | |
I.push_back(17); | |
I.push_back(0); | |
I.push_back(-15); | |
cout << I.back() << "\n"; | |
// imprimimos o ultimo elemento de I, no caso -15 |
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
vector<int> I; | |
I.push_back(10); | |
I.push_back(17); | |
I.push_back(0); | |
I.push_back(-15); | |
cout << I.front() << "\n"; | |
// imprimimos o primeiro elemento de I, no caso 10 |
NewerOlder